Jump to content

Recommended Posts

Posted

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? :whistle:

Thank you

  • Moderators
Posted

Worked fine for me beta .132

CLOSEClicked()
Func CLOSEClicked($msg = "", $mopt = 0)
  MsgBox($mopt, '', $msg)
  Exit
EndFunc
Of course I had to take out the $LangAry[$langID][1] :whistle:

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.

Posted

Worked fine for me beta .132

CLOSEClicked()
Func CLOSEClicked($msg = "", $mopt = 0)
  MsgBox($mopt, '', $msg)
  Exit
EndFunc
Of course I had to take out the $LangAry[$langID][1] :whistle:
$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!

Posted

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.

Posted

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 :whistle:

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...