BlueScreen Posted July 30, 2004 Share Posted July 30, 2004 (edited) Hi Guys, I think I am missing something here. Adlibenable ("x",5000) For $i=1 to 1000 ToolTip($i, 0, 0) sleep (200) Next Adlibdisable () Func x () Sleep (10000) EndFunc If I understand right, the x function will be executed every 5 secs, and in the mean while the main script paused. So why when the 10 seconds (in the x func) are over the tooltip doesn't continue? 10x in advance, guys... Edited July 30, 2004 by BlueScreen Link to comment Share on other sites More sharing options...
ezzetabi Posted July 30, 2004 Share Posted July 30, 2004 Remarks Every 250 ms (or time ms) the specified "function" is called--typically to check for unforeseen errors. For example, you could use adlib in a script which causes an error window to pop up unpredictably. The adlib function should be kept simple as it is executed often and during this time the main script is paused. Also, the time parameter should be used carefully to avoid CPU load. Link to comment Share on other sites More sharing options...
BlueScreen Posted July 30, 2004 Author Share Posted July 30, 2004 ezzetabi, I have read the Help. I still cannot understand why the tooltip doesn't continue counting. Link to comment Share on other sites More sharing options...
ezzetabi Posted July 30, 2004 Share Posted July 30, 2004 (edited) The fact is that you stop the script for 10 sec every 5 sec. So the effect is that every 10 second more or less the loop is executed only once. Edited July 30, 2004 by ezzetabi Link to comment Share on other sites More sharing options...
BlueScreen Posted July 30, 2004 Author Share Posted July 30, 2004 (edited) OK. my mistake. But if I fix it and do this:Adlibenable ("x",15000) For $i=1 to 1000 ToolTip($i, 0, 0) sleep (200) Next Adlibdisable () func x () Sleep (5000) EndFunc The script starts and tooltip start counting. after 15 secs, there is a sleep of 5 secs. Once this sleep is over, I expected that the tooltip will count for another 15 seconds, but it counts only ~10 secs. Why? Is it because once the function is started 'Adlib' timer starts also? Edited July 30, 2004 by BlueScreen Link to comment Share on other sites More sharing options...
pekster Posted July 30, 2004 Share Posted July 30, 2004 Yea, basically. Every 15 seconds the adlib is processed, and causes it to pause for 5. That eats away into 5 seconds of the 15 until the next 5 second pause, so you only have 10 seconds left for the rest of the script before the adlib is executed agian. [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes. Link to comment Share on other sites More sharing options...
BlueScreen Posted July 30, 2004 Author Share Posted July 30, 2004 Got it, finally... Thanks everybody. Link to comment Share on other sites More sharing options...
trids Posted July 30, 2004 Share Posted July 30, 2004 (edited) I agree, the behaviour is weird, BlueScreen I modified your scriptlet slightly, which reveals interesting results:Adlibenable ("x",5000) For $i=1 to 1000 ToolTip("Loop:" & $i, 400, 300) sleep (200) Next Adlibdisable () Func x () ToolTip("AdlibStart", 400, 300) Sleep (10000) ;change this value for interesting results ToolTip("AdlibEnd", 400, 300) Sleep(1000);this shows that the func is looping EndFunc.. See what they have to say on the Bug Reports forum .. ?Edit: ... Since the helpfile does say that the rest of the script pauses. Which leads me to expect the timer to continue only after the adlib function terminates. But then, perhaps it's just a matter of interpretation of what actually pauses, and if this includes the timer or not? My head hurts - where's that weekend Edited July 30, 2004 by trids Link to comment Share on other sites More sharing options...
Administrators Jon Posted July 30, 2004 Administrators Share Posted July 30, 2004 (edited) The script "pauses" in the sense that lines from the main script are not executed while lines from the adlib section are. The timers always update because...you can't stop time (The TimerInit() function simply returns the current PC time and TimerDiff works out the difference, pausing the script doesn't affect the PC time IYSWIM) Edited July 30, 2004 by Jon Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
trids Posted July 30, 2004 Share Posted July 30, 2004 OK ... thanks for making sense of it, Jon Might be worth mentioning this in the AdlibEnable topic of the CHM? Link to comment Share on other sites More sharing options...
BlueScreen Posted July 31, 2004 Author Share Posted July 31, 2004 10x, Jon and trids. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now