DjDeep00 Posted June 14, 2007 Share Posted June 14, 2007 Is it possible somehow to ignore all the warnings. I am getting a millions of warnings stating "possibly used before declaration" even though all the variables are already been declared globably. I am using "AutoIt3Wrapper v.1.9.1" It would be nice to just have the errors and not the warnings. Thanks. Link to comment Share on other sites More sharing options...
evilertoaster Posted June 14, 2007 Share Posted June 14, 2007 disussed here i think- http://www.autoitscript.com/forum/index.php?showtopic=18584don't know if they nessicarly mentioned a way to disable the warnings though so much as avioding them... Link to comment Share on other sites More sharing options...
Developers Jos Posted June 14, 2007 Developers Share Posted June 14, 2007 Is it possible somehow to ignore all the warnings. I am getting a millions of warnings stating "possibly used before declaration" even though all the variables are already been declared globably. I am using "AutoIt3Wrapper v.1.9.1" It would be nice to just have the errors and not the warnings. Thanks.The errors are coming from AU3check and you want to cure the cause, not the symptoms... It means that Au3Check "sees" you use a variable possibly before declaring it. Are you doing the Global ... in A func in stead of the main/top section of the program ? 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...
DjDeep00 Posted June 14, 2007 Author Share Posted June 14, 2007 The errors are coming from AU3check and you want to cure the cause, not the symptoms... It means that Au3Check "sees" you use a variable possibly before declaring it. Are you doing the Global ... in A func in stead of the main/top section of the program ? JdeB...Thanx for helping me out with this...Here is an example of what I am doing... When I complile the code below..i get these errors: +>15:51:11 Starting AutoIt3Wrapper v.1.9.1 >Running AU3Check (1.54.7.0) from:C:\Program Files\AutoIt3 C:\Documents and Settings\dj.deep\Desktop\Test.au3(23,28) : WARNING: $Button: possibly used before declaration. Case $msg = $Button ~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\dj.deep\Desktop\Test.au3(10,49) : WARNING: $Button: declared global in function only. Prefer top of file. Global $Button=GUICtrlCreateButton("Test",50,50) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\dj.deep\Desktop\Test.au3 - 0 error(s), 2 warning(s) ->15:51:11 AU3Check ended.rc:1 >Running:(3.2.3.14):C:\Program Files\AutoIt3\autoit3.exe "C:\Documents and Settings\dj.deep\Desktop\Test.au3" +>15:51:27 AutoIT3.exe ended.rc:0 +>15:51:28 AutoIt3Wrapper Finished #include <GUIConstants.au3> GUI () GUI_Loop () Func GUI () GUICreate("My GUI") ; will create a dialog box that when displayed is centered Global $Button=GUICtrlCreateButton("Test",50,50) GUISetState (@SW_SHOW) ; will display an empty dialog box EndFunc Func GUI_Loop () ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button MsgBox(0, 'Testing', 'Button 2 was pressed') ; Will demonstrate Button 2 being pressed EndSelect Wend EndFunc Link to comment Share on other sites More sharing options...
Developers Jos Posted June 14, 2007 Developers Share Posted June 14, 2007 Just define the variable at the top of the script like this: #include <GUIConstants.au3> ; Define Global variables. Global $Button GUI() GUI_Loop() Func GUI() GUICreate("My GUI") ; will create a dialog box that when displayed is centered $Button = GUICtrlCreateButton("Test", 50, 50) GUISetState(@SW_SHOW) ; will display an empty dialog box EndFunc ;==>GUI Func GUI_Loop() ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button MsgBox(0, 'Testing', 'Button 2 was pressed') ; Will demonstrate Button 2 being pressed EndSelect WEnd EndFunc ;==>GUI_Loop 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...
DjDeep00 Posted June 14, 2007 Author Share Posted June 14, 2007 Just define the variable at the top of the script like this: #include <GUIConstants.au3> ; Define Global variables. Global $Button GUI() GUI_Loop() Func GUI() GUICreate("My GUI") ; will create a dialog box that when displayed is centered $Button = GUICtrlCreateButton("Test", 50, 50) GUISetState(@SW_SHOW) ; will display an empty dialog box EndFunc ;==>GUI Func GUI_Loop() ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button MsgBox(0, 'Testing', 'Button 2 was pressed') ; Will demonstrate Button 2 being pressed EndSelect WEnd EndFunc ;==>GUI_Loop Thanx JdeB...you are correct, if I do it like that then I will not get warnings...but I have many many controls that I declared like that...I guess I was just curious to know if it was possible to disable the warnings...Its kool..I will modify the script... Link to comment Share on other sites More sharing options...
Developers Jos Posted June 14, 2007 Developers Share Posted June 14, 2007 Thanx JdeB...you are correct, if I do it like that then I will not get warnings...but I have many many controls that I declared like that...I guess I was just curious to know if it was possible to disable the warnings...Its kool..I will modify the script...The other common sense thing could be to keep the GUI creation and The Message loop in one Func which would also avoid the warnings. 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...
DjDeep00 Posted June 15, 2007 Author Share Posted June 15, 2007 The other common sense thing could be to keep the GUI creation and The Message loop in one Func which would also avoid the warnings.Jdeb...Sometimes common sense is not very common...lol... 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