Fargo Posted July 28, 2006 Share Posted July 28, 2006 Func CLOSEClicked($msg="", $mopt=0) MsgBox($mopt, $LangAry[$langID][1], $msg) Exit EndFunc If I call the above function without passing any var, then autoit complains! It says $mopt is used without being declared. It seems functions in autoit cannot have all parameters as optional, right? Thank you Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 28, 2006 Moderators Share Posted July 28, 2006 Worked fine for me beta .132 CLOSEClicked() Func CLOSEClicked($msg = "", $mopt = 0) MsgBox($mopt, '', $msg) Exit EndFuncOf course I had to take out the $LangAry[$langID][1] Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
ivan Posted July 28, 2006 Share Posted July 28, 2006 works with beta 131 Think out of the boxGrabber: Yet another WinInfo tool_CSVLib (still alpha)Dynamic html in au3 Link to comment Share on other sites More sharing options...
Fargo Posted July 28, 2006 Author Share Posted July 28, 2006 Worked fine for me beta .132 CLOSEClicked() Func CLOSEClicked($msg = "", $mopt = 0) MsgBox($mopt, '', $msg) Exit EndFuncOf course I had to take out the $LangAry[$langID][1] $LangAry and $langID are globally defined. I think this is a bug! I only get the error msg when the function is called by GUICtrlSetOnEvent. When I call the function directly, no error is given! Link to comment Share on other sites More sharing options...
Valik Posted July 28, 2006 Share Posted July 28, 2006 That's not a bug, that's a feature that isn't supported. Link to comment Share on other sites More sharing options...
Fargo Posted July 28, 2006 Author Share Posted July 28, 2006 I tested this with the latest beta and the problem is still there. To work around this, you need to define vars at the beginning of the script with Global. Link to comment Share on other sites More sharing options...
Fargo Posted July 28, 2006 Author Share Posted July 28, 2006 That's not a bug, that's a feature that isn't supported.Ah, that you Valik. I think I need to live with this then 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