Bokkie Posted March 11, 2006 Share Posted March 11, 2006 (edited) I have this option defined as the first line of code in my script after any #includes.Opt("MustDeclareVars", 1)But the undeclared variable mmmmsg does not raise any compilation error to say it's not declared.while 1 local $msg = GuiGetMsg() local $control = ControlGetFocus($mainForm) PositionToEndOfLine($control) select case $mmmmsg = $GUI_EVENT_CLOSE ExitLoopThe documentation for Opt() states: If this option is used then all variables must be pre-declared with Dim, Local or Global before they can be used - removes the chance for misspelled variables causing bugs.What am I doing wrong? Edited March 11, 2006 by Peter Hamilton-Scott Link to comment Share on other sites More sharing options...
Bokkie Posted March 11, 2006 Author Share Posted March 11, 2006 (edited) I've no idea what was going on but it came right after I rebooted! Edited March 11, 2006 by Peter Hamilton-Scott Link to comment Share on other sites More sharing options...
Developers Jos Posted March 11, 2006 Developers Share Posted March 11, 2006 (edited) When you run (AutoIt3) not compile this code: Opt("MustDeclareVars", 1) $mainForm = 1 local $msg = GuiGetMsg() If 0 = 1 Then If $mmmmsg = $GUI_EVENT_CLOSE Then $a = 1 EndIf EndIf An error will be triggered with Opt("MustDeclareVars", 1) and runs fine with Opt("MustDeclareVars", 0) Edited March 11, 2006 by JdeB 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...
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