funkey Posted April 10, 2014 Share Posted April 10, 2014 (edited) #include <GUIConstantsEx.au3> Global $hGui = GUICreate("Test Bug 'Static'", 200, 60) _Update() _Update() AdlibRegister("_Update", 1000) GUISetState() Do Until GUIGetMsg() = $GUI_EVENT_CLOSE Func _Update() Local Static $fBackup If $fBackup = "" Then ConsoleWrite("First call of '_Update()'" & @LF) Else ConsoleWrite($fBackup & @LF) EndIf Local $fValue = Random(1, 10, 1) $fBackup = $fValue EndFunc Edited April 10, 2014 by Melba23 Amended title Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning. Link to comment Share on other sites More sharing options...
jchd Posted April 10, 2014 Share Posted April 10, 2014 What is the bug? 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...
JohnOne Posted April 10, 2014 Share Posted April 10, 2014 First call of '_Update()' 10 First call of '_Update()' 9 6 8 3 etc... AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
czardas Posted April 10, 2014 Share Posted April 10, 2014 The bug is the variable loses it's static assigned value when you run that code. operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
JohnOne Posted April 10, 2014 Share Posted April 10, 2014 #include <GUIConstantsEx.au3> Global $hGui = GUICreate("Test Bug 'Static'", 200, 60) _Update() _Update() AdlibRegister("_Update", 1000) GUISetState() Do Until GUIGetMsg() = $GUI_EVENT_CLOSE Func _Update() Local Static $fBackup = 0 Local $fValue = 0 If $fBackup = 0 Then ConsoleWrite("First call of '_Update()'" & @LF) $fValue = Random(1, 10, 1) Else ConsoleWrite($fBackup & @LF) EndIf $fValue = Random(1, 10, 1) $fBackup = $fValue EndFunc Bug present in 3.3.8.1 Bug not present in latest beta. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
funkey Posted April 10, 2014 Author Share Posted April 10, 2014 Bug present in 3.3.8.1 Bug not present in latest beta. Then I should really look forward to 3.3.10.2. But I'm afraid of false positives in company. Never had problems with 3.3.8.1 Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning. Link to comment Share on other sites More sharing options...
jchd Posted April 10, 2014 Share Posted April 10, 2014 I don't get that! Release: Running:(3.3.10.2):C:Program Files (x86)AutoIt3autoit3.exe First call of '_Update()' 3 10 7 3 ... First call of '_Update()' 4 10 3 ... Ran dozen times and no bug appears here. Same with beta: Running:(3.3.11.4):C:\Program Files (x86)\AutoIt3\Beta\autoit3.exe 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...
funkey Posted April 10, 2014 Author Share Posted April 10, 2014 @jchd: It's already fixed in latest stable. Sorry for not searching enough before posting. Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning. Link to comment Share on other sites More sharing options...
jchd Posted April 10, 2014 Share Posted April 10, 2014 Ah, I was experimenting with x64 vs x86, various delays, Sleep between inline invokations, etc but to no avail. Latest release and latest beta indeed seem to work as intended. No harm done, glad it's a false alarm. 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...
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