... is a special variable name that holds an indefinite number of parameters.
It's called a vararg (variable arguments)
When you don't know how many params will be passed to a function
(OnEvent is a prime example as different events pass a different number of arguments)
you can use a vararg to catch them all.
To assign the individual arguments to variables you can just do:
local arg1, arg2, arg3, argX = ...
inside the function.
If you want to know the number of arguments in the vararg
local args = select("#",...) will give you that.
Last edited by Dridzt : 11-02-10 at 07:00 PM.
|