| View previous topic :: View next topic |
| Author |
Message |
mikronos
Joined: 14 Feb 2007 Posts: 15 Location: France
|
Posted: Sun Mar 11, 2007 6:12 pm Post subject: force an expression in SetTimer |
|
|
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 |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6856 Location: Pacific Northwest, US
|
Posted: Sun Mar 11, 2007 6:40 pm Post subject: |
|
|
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 |
|
 |
mikronos
Joined: 14 Feb 2007 Posts: 15 Location: France
|
Posted: Sun Mar 11, 2007 6:49 pm Post subject: |
|
|
| thx, but doesn't work... |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Sun Mar 11, 2007 10:56 pm Post subject: |
|
|
engunneer, a bit off base... 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 |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6856 Location: Pacific Northwest, US
|
Posted: Sun Mar 11, 2007 10:57 pm Post subject: |
|
|
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 |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 4065 Location: Pittsburgh
|
Posted: Mon Mar 12, 2007 12:13 am Post subject: |
|
|
| 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 |
|
 |
mikronos
Joined: 14 Feb 2007 Posts: 15 Location: France
|
Posted: Mon Mar 12, 2007 8:07 am Post subject: |
|
|
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 |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 3004 Location: Minnesota
|
Posted: Mon Mar 12, 2007 10:17 pm Post subject: |
|
|
| 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 |
|
 |
|