milos83 Posted yesterday at 01:33 AM Posted yesterday at 01:33 AM (edited) Using latest Autoit The following code never gets to the third line (msgbox). Why? CheckWorkers() Sleep(1000) MsgBox(0,0,0);never gets here Func CheckWorkers() AdlibUnRegister("CheckWorkers") Sleep(1000) AdlibRegister("CheckWorkers", 1000) EndFunc The bottom line is, if the duration of the function is >= Adlib interval, it will run forever. No matter if you did AdlibUnRegister on function start or not. Edited yesterday at 01:49 AM by milos83
Nine Posted yesterday at 03:17 AM Posted yesterday at 03:17 AM That is a truly bad written code. What would be the purpose of creating such a bad logic ? If you are trolling us to explain why, I suggest you take the time to test you false assumptions. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Multi-Threading Made Easy
lIlIIlIllIIIIlI Posted yesterday at 03:57 AM Posted yesterday at 03:57 AM (edited) I am guessing if the duration of AdlibRegister("CheckWorkers", 1000) is equal to the first Sleep(1000), it cannot ever reach that Sleep, because you scheduled it to run CheckWorkers. Edited yesterday at 04:00 AM by lIlIIlIllIIIIlI
argumentum Posted yesterday at 03:58 AM Posted yesterday at 03:58 AM 2 hours ago, milos83 said: The following code never gets to the third line (msgbox). Why ? Global $iSleep = 500 ; 1000 codeIsAtLineNumber() CheckWorkers() codeIsAtLineNumber() Sleep($iSleep) codeIsAtLineNumber() MsgBox(262144, "0", "0", 10) ;never gets here codeIsAtLineNumber() Func CheckWorkers() codeIsAtLineNumber() AdlibUnRegister("CheckWorkers") Sleep($iSleep) AdlibRegister("CheckWorkers", 1000) codeIsAtLineNumber() EndFunc ;==>CheckWorkers Func codeIsAtLineNumber($iScriptLineNumber = @ScriptLineNumber) ConsoleWrite("@@(" & $iScriptLineNumber & ") : " & @MIN & ":" & @SEC & "." & @MSEC & @CRLF) EndFunc ;==>codeIsAtLineNumber ..because, it interrupts the main code to run the AdLib. And you don't give it a chance to do anything else. 37 minutes ago, Nine said: That is a truly bad written code. Ain't that the truth. 2 hours ago, milos83 said: The bottom line is,... I don't know what the bottom line is. Looking at parallel processing in the WiKi would be the thing to do if the other function is so ..., time consuming ? Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
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