Throw an error about a wrong parameter of a function - with the name of this parameter
Posted: 04 Oct 2020, 16:12
If you run the following Hotstring() example,
there will be thrown an error:
I know there is A_ThisFunc variable, but I don't know about anything like A_ThisFuncArgs.
Code: Select all
Hotstring(":*:btw", "by the way", "WrongArg")
How to achieve the same effect (that is, to report the name of the wrong argument) with a custom function?Error: Parameter #3 invalid.
Specifically: WrongArg
I know there is A_ThisFunc variable, but I don't know about anything like A_ThisFuncArgs.
Code: Select all
func(parameter) {
if parameter not in foo,bar,baz
throw
else
return "success"
}
func("aaa") ; Should throw an error