JoGa Posted July 9, 2011 Share Posted July 9, 2011 Greetings! I have an Adlib function "runAdlib" which normally takes 0.1 seconds. The function is registered to run every 2 seconds. Under certain circumstances the Adlib function has to do some more work, running between 0.5 and perhaps 3 seconds. To prevent the function to be run while active, I do a AdlibUnRegister("runAdlib") as 1st statement in the function. The function is registered before exit of the function: AdlibRegister("runAdlib", 2000) See also attached sample program "AT1.au3". However, it appears that the duration of the function runAdlib is accumulated to the interval time between I want the function to be run. This ends up in an interval way below 2 seconds if the adlib function takes more time. The system is WinXP/SP3 and AutoIt-3.3.6.1. What am I doing wrong? Do I misunderstand the AdlibRegister call? Attached is a sample code (AT1.au3) to describe the issue. The logfile AT1.log, produced by AT1.au3, shows the following: 17:04:45.078 runAdlib-in after=21892.276251 17:04:47.203 runAdlib-out elapsed=2.152 17:04:49.234 runAdlib-in after=2.007809 <--- ok, 2 seconds 17:04:51.375 runAdlib-out elapsed=2.159 17:04:51.406 runAdlib-in after=0.020625 <--- too soon 17:04:53.515 runAdlib-out elapsed=2.130 17:04:53.562 runAdlib-in after=0.020682 <--- too soon 17:04:55.671 runAdlib-out elapsed=2.123 ... Thanks for hints and enlightment :-)AT1.au3 Link to comment Share on other sites More sharing options...
jchd Posted July 9, 2011 Share Posted July 9, 2011 This is a known problem which has been fixed with ongoing betas. See Trac #1633 and #1907 (possibly others). This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
martin Posted July 9, 2011 Share Posted July 9, 2011 (edited) Another approach is to leave the adlib registered rather than unregister it, but use a global variable like this. Global $Busy = false AdlibRegister("FuncA",2000) . . .. FuncA() if $busy then return $Busy = true .;stuff $Busy = false endfunc Edited July 9, 2011 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. 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