var := 123 test() test(param = var) { MsgBox % param }This doesn't work.
var := 123 test() test(param = False) { global if !param param := var MsgBox % param }I'm doing this instead but looklng for some simpler ways.
var := 123 test() test(param = var) { MsgBox % param }This doesn't work.
var := 123 test() test(param = False) { global if !param param := var MsgBox % param }I'm doing this instead but looklng for some simpler ways.
var := 123 test() test(param = var) { MsgBox % param }
(help file, function, optional parameters)A parameter's default value must be one of the following: true, false, a literal integer, a literal floating point number, or a quoted/literal string such as "fox" or "" (but strings in versions prior to 1.0.46.13+ support only "").
Hi, is it possible to use a variable for a function default parameter?
var := 123 test() test(param = var) { MsgBox % param }
var=123 ; using the := means you are assigned var to the variables "123" and not the value test (var) ; this will make param=var in the function "test" test(param) { msgbox, %param% ; for the above, it will be "var" }