AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

force an expression in SetTimer

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
mikronos



Joined: 14 Feb 2007
Posts: 15
Location: France

PostPosted: Sun Mar 11, 2007 6:12 pm    Post subject: force an expression in SetTimer Reply with quote

Hi all,

I need your help again on this sunday.

Initializing timer like this doesn't work:

SetTimer,tim1,1000*60*3
or
SetTimer,tim1,% 1000*60*3

doesn't work too. The only way I found is to use a variable (!) like this:

val := 1000*60*3
SetTimer,tim1,%val%

How can I avoid the use of a variable ?

Of course I know that I can compute the value 1000*60*3 myself and use the result... But the manual say that we can force an expression in a parameter that does not directly support it.(help Variables and Expressions) So how to ??

Thanks!!
-Mikronos
Back to top
View user's profile Send private message
engunneer



Joined: 30 Aug 2005
Posts: 6856
Location: Pacific Northwest, US

PostPosted: Sun Mar 11, 2007 6:40 pm    Post subject: Reply with quote

maybe:
Code:

settimer % tim1, 1000*60*3

? (untested)
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
mikronos



Joined: 14 Feb 2007
Posts: 15
Location: France

PostPosted: Sun Mar 11, 2007 6:49 pm    Post subject: Reply with quote

thx, but doesn't work...
Back to top
View user's profile Send private message
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Sun Mar 11, 2007 10:56 pm    Post subject: Reply with quote

engunneer, a bit off base... Smile I don't see how putting % in front of the label would help.
mikronos, SetTimer tim1, % 1000*60*3 should have worked. It doesn't so either there is a limitation (perhaps because of the textual parameters On & Off) or this is a bug...
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
engunneer



Joined: 30 Aug 2005
Posts: 6856
Location: Pacific Northwest, US

PostPosted: Sun Mar 11, 2007 10:57 pm    Post subject: Reply with quote

sometimes i just make up answers, i almost never use the % to expressionalize commands, so I thought maybe it had to be the first parameter. That's what i get for not looking it up.
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
Laszlo



Joined: 14 Feb 2005
Posts: 4065
Location: Pittsburgh

PostPosted: Mon Mar 12, 2007 12:13 am    Post subject: Reply with quote

PhiLho wrote:
this is a bug...
It is. Especially, because adding or appending a dummy variable makes it to work:
Code:
#Persistent
SetTimer tim1, % 10*3 _
Return

tim1:
  TrayTip,,%A_TickCount%
Return
If the 2nd parameter contains a variable name ("_"), it works.
Back to top
View user's profile Send private message
mikronos



Joined: 14 Feb 2007
Posts: 15
Location: France

PostPosted: Mon Mar 12, 2007 8:07 am    Post subject: Reply with quote

Thanks all for replies!!
I'll use a variable name in the line like in your example.

-Mikronos.

BTW should we move this thread to the bug reports ?
Back to top
View user's profile Send private message
jonny



Joined: 13 Nov 2004
Posts: 3004
Location: Minnesota

PostPosted: Mon Mar 12, 2007 10:17 pm    Post subject: Reply with quote

mikronos wrote:
BTW should we move this thread to the bug reports ?


It's already a known bug in the syntax checker, and will be addressed in due time.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group