Quote:
Originally Posted by Stefan
The params[] array is only created when the script is called (doesn't even need to be a function, GS1 style). That is either on an event, or when you call a function of another object. To get a variable number of parameters either use func(arg1, arg2, arg3, arg4 etc) and ignore the arguments that you don't want, or pass the parameters as array.
|
Thanks, that clears it up. Some experimentation suggested the FAQ thread was inaccurate about this and some dude on IRC said it only worked for triggers, so that makes sense.
Quote:
Currently accessing the parameters for each function as array is not possible because it would mean a big speed slowdown, although if it's really important to have it then we could add something like temp.functionparams[] which dynamically converts the function parameters to variables.
|
Not important, I really just wanted to build an error reporting function that would forward all its arguments to format() and print the resulting string with more error stuff, instead of having the user call format, and consequently got confused about how variadic functions even work.