 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
beardboy
Joined: 02 Mar 2004 Posts: 444 Location: SLC, Utah
|
Posted: Sat May 01, 2004 5:06 pm Post subject: SetTimer and Sleep |
|
|
I'm running into a problem where if a Timer is called in the middle of a Sleep command when the Timer tries to return it never returns.
| Code: | 143: IniRead,title,%inifile%,Window%A_Index%,Title
144: IniRead,type,%inifile%,Window%A_Index%,Type
145: IF type is not number
146: {
147: Break
175: Sleep,250 (0.01)
351: presstime2 = %A_MDay%%A_hour%%A_Min%%A_Sec%
352: IF presstime2 >= %presstime%
353: {
354: ToolTip
355: SetTimer,ToolTipOff,off
356: }
357: Return (50.10) |
The Sleep was the very last line of 154 line Loop. But I have put it at the begining, in the middle, and at the end. And everytime it gets stuck like that is when the Timer is called during the Sleep. The timer is Rajat's time check to turn off SplashText.
I did a small test script and it does the same thing. But it appear to only happen when you turn off the Timer within the Timer.
| Code: | SetTimer, Test, 250
Loop
{
SetTimer, Test, on
IniRead, VPNMsg, %systemroot%\system32\ProxyED.ini, General, VPNMsg ; Check INI value
Sleep, 1000
}
Test:
IniRead, temp, %systemroot%\system32\ProxyED.ini, General, AutoVPN ; Check INI value
SetTimer, Test, off
return |
| Code: | 006: SetTimer,Test,250
008: Loop
009: {
010: SetTimer,Test,on
011: IniRead,VPNMsg,%systemroot%\system32\ProxyED.ini,General,VPNMsg
012: Sleep,1000 (0.25)
016: IniRead,temp,%systemroot%\system32\ProxyED.ini,General,AutoVPN
017: SetTimer,Test,off
018: Return (191.01) |
thanks,
beardboy |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Sat May 01, 2004 6:10 pm Post subject: |
|
|
Thanks for a very nice bug report; it helped me find the problem very quickly.
I've updated the installer again:
Fixed: If a script had exactly one timer and it turned itself off during a Sleep or other delay, the script would sleep forever. [thanks beardboy] |
|
| Back to top |
|
 |
beardboy
Joined: 02 Mar 2004 Posts: 444 Location: SLC, Utah
|
Posted: Sat May 01, 2004 6:18 pm Post subject: |
|
|
Chris,
Thanks for the quick fix. This was the same problem I was running into before, and thanks to the elapsed time between lines I was finally able to track it down.
thanks,
beardboy |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|