Code: Select all
testFunc(parameter := new Object())
{
return 123
}
Why not?
Code: Select all
testFunc(parameter := new Object())
{
return 123
}
Optional Parameters ([url=http://ahkscript.org/docs/Functions.htm#optional]link[/url]) wrote: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 "").
Code: Select all
testFunc(parameters*)
{
parameter := parameters.MaxIndex() ? parameters[1] : parameters
MsgBox % IsObject(parameter)
}
testFunc()
return
Users browsing this forum: Chunjee, Hansielein, Lpanatt and 324 guests