Exit Posted July 27, 2019 Share Posted July 27, 2019 All following three scripts generate an Au3Check error. Is this an Au3Check bug or did I miss something? #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 Func _test() Local $rc = 1 ? Beep() : "" EndFunc ;==>_test _test() #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 Func _test() Local $rc $rc = 1 ? Beep() : "" EndFunc ;==>_test _test() #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 Func _test() $rc = 1 ? Beep() : "" EndFunc ;==>_test _test() App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
Subz Posted July 27, 2019 Share Posted July 27, 2019 (edited) It actually tells you what the issue is, the variable is declared but not used, if you use it you won't have an issue. Your last example you didn't declare the variable or use it within the function. #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 Func _test() Local $rc = 1 ? Beep() : "" ConsoleWrite($rc & @CRLF) EndFunc ;==>_test _test() Edited July 27, 2019 by Subz Exit 1 Link to comment Share on other sites More sharing options...
Danp2 Posted July 27, 2019 Share Posted July 27, 2019 Seems like an issue with assignments using the ternary operator. Exit 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
mikell Posted July 28, 2019 Share Posted July 28, 2019 As the ternary operator seems to have a higher precedence than the assignment I rather think of a misuse in this case Func _test() $rc = "whatever" ? Beep() : "" ConsoleWrite($rc & @CRLF) EndFunc ;==>_test _test() This code consolewrites 1 which is the return value of beep because the conditional "whatever" is considered as true - IMHO Link to comment Share on other sites More sharing options...
jchd Posted July 28, 2019 Share Posted July 28, 2019 (edited) #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 Func _test() #forcedef $rc #forceref $rc $rc = 1 ? Beep() : "" EndFunc ;==>_test _test() Works like a charm. EDIT: inelegant "solution", see correction below Edited July 28, 2019 by jchd 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...
Exit Posted July 28, 2019 Author Share Posted July 28, 2019 41 minutes ago, jchd said: #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 Func _test() #forcedef $rc #forceref $rc $rc = 1 ? Beep() : "" EndFunc ;==>_test _test() Works like a charm. OK, that's one way to get around the bug. There is a simpler one though: #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 Global $rc Func _test() $rc = 1 ? Beep() : "" EndFunc ;==>_test _test() But both are emergency solutions. The ternary assignment is actually not that complex that Au3Check should not handle it. So it seems to be an Au3Check bug. App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
jchd Posted July 28, 2019 Share Posted July 28, 2019 Using global pollutes the variable space IMHO. The less globals, the less problems. And yes this is a minor Au3Check issue with the ternary op. Exit 1 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...
Bowmore Posted July 28, 2019 Share Posted July 28, 2019 This is not a bug in au3check. The variable $rc in you function is initialised but never read/used, hence the warning. In your test function $rc is completely redundant. #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 Func _test() Local $rc = 1 ? Beep() : "" EndFunc ;==>_test _test() argumentum 1 "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook Link to comment Share on other sites More sharing options...
Developers Jos Posted July 28, 2019 Developers Share Posted July 28, 2019 13 minutes ago, Exit said: The ternary assignment is actually not that complex that Au3Check should not handle it. So you are willing to take up the challenge and fix au3check for everybody? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Exit Posted July 28, 2019 Author Share Posted July 28, 2019 (edited) @Jos Jos, I would like to help, but you overestimate my ability by far. Edited July 28, 2019 by Exit App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
jchd Posted July 28, 2019 Share Posted July 28, 2019 @Bowmore You're right, the issue isn't precisely that. There are still actual minor issues with ?: in Au3Check if I recall correctly albeit I don't remember which use case right now. Here it's rather the use of a pointless ternary assignment that's causing the warning. I believe the OP's original code is more involved but boils down to the example posted. Also the code can be logically simplified: #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 Func _test() Local $rc = 1 ? Beep() : "" #forceref $rc EndFunc ;==>_test _test() Exit 1 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...
Developers Jos Posted July 28, 2019 Developers Share Posted July 28, 2019 15 minutes ago, Exit said: @Jos Jos, I would like to help, but you overestimate my ability by far. .. but you were the one stating it should be 'trivial"...no? Exit 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 28, 2019 Developers Share Posted July 28, 2019 11 minutes ago, jchd said: There are still actual minor issues with ?: in Au3Check if I recall correctly albeit I don't remember which use case right now. You mean this one? : https://www.autoitscript.com/trac/autoit/ticket/3624 Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
jchd Posted July 28, 2019 Share Posted July 28, 2019 4 minutes ago, Jos said: but you were the one stating it should be 'trivial"...no? and the trap closed on the reckless ... Exit 1 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...
jchd Posted July 28, 2019 Share Posted July 28, 2019 3 minutes ago, Jos said: You mean this one? No it was more along a real-world involved statement, but can't find it. Zero importance anyway. 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...
Exit Posted July 28, 2019 Author Share Posted July 28, 2019 4 minutes ago, Jos said: .. but you were the one stating it should be 'trivial"...no? No, I just said that the ternary assignment is actually not that complex App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
mikell Posted July 28, 2019 Share Posted July 28, 2019 The issue seems to be that Au3check isn't able to say 'this code is inconsistent' #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 Func _test() Local $rc = 25 ? Beep() : "" #forceref $rc Consolewrite($rc & @crlf) EndFunc ;==>_test _test() Link to comment Share on other sites More sharing options...
Developers Jos Posted July 28, 2019 Developers Share Posted July 28, 2019 (edited) 8 minutes ago, mikell said: The issue seems to be that Au3check isn't able to say 'this code is inconsistent' Correct, Ternary type statements were introduced much later and all we (i) have done in au3check is to tolerate the ternary statements, so trying to avoid wrong warnings/errors, but never tried to implement checking the validity as they aren't as easy as some of us think they are. I have said it already many times before, but my brains aren't build to think in the way YACC & FLEX work, so I am trying to stay out of that code when there is no real problem. Jos Edited July 28, 2019 by Jos Exit 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
TheDcoder Posted July 24, 2021 Share Posted July 24, 2021 Sorry, I am 2 years late to the party, but I stumbled across this thread while searching for something, I can perhaps take a look at those YACC and FLEX bugs as I am a certified professional now because I read the book about them. @Jos Are these bugs still relevant? If so, I can offer my assistance if that is okay, please advice. mLipok 1 EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
argumentum Posted July 24, 2021 Share Posted July 24, 2021 (edited) the latest au3check works properly in regard to:#AutoIt3Wrapper_Au3Check_Parameters= -d #AutoIt3Wrapper_Au3Check_Parameters=-w 5 ..tho that is the extent of my testing Edited July 24, 2021 by argumentum Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. 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