Ejoc Posted March 25, 2005 Posted March 25, 2005 (edited) So I set an optional parameter to see if I call it via a menu or via HotKey, this is a simplified example: The first 2 calls to test() work as expected, but when I call it w/ the hotkey a, it breaks... EDIT I know I can check @NUMPARAMS it see if a param was passed, but it seems like something is broken. If Not @NUMPARAMS Then local $opt_param = 0 Global $i HotKeySet("a","test") test(1) test() $i = 1 while $i sleep(250) WEnd Func test($opt_param = 0) MSGBox(0,"","$opt_parm = " & $opt_param) $i = 0 EndFunc Edited March 25, 2005 by Ejoc Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs
Developers Jos Posted March 25, 2005 Developers Posted March 25, 2005 ... strange, guess this needs to be checked.... here's a work around:Global $i HotKeySet("a","test") test(1) test() $i = 1 while $i sleep(250) WEnd Func test($opt_param = 0) if not IsDeclared("opt_param") then $opt_param = 0 MSGBox(0,"","$opt_parm = " & $opt_param) $i = 0 EndFunc 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.
Ejoc Posted March 25, 2005 Author Posted March 25, 2005 That works, thanks. Does seem to be broken tho. Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs
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