Posted 10 August 2012 - 07:28 PM
Is there a way to define a function that can take an unknown number of arguments?
function myFunction(...)
local tArgs = { ... } -- store the arguments on a table, so we can access them
for i, v in ipairs(tArgs) do -- for each argument passed
print(i, ": ", v) -- print the arg number and the value
end
end