In lua I'm using someone elses function that takes variable number of arguments. What I would like to be able to do is build the argument list via loop. Is this possible?
Example function:
printResult = ""
function print (...)
for i,v in ipairs(arg) do
printResult = printResult .. tostring(v) .. "\t"
end
printResult = printResult .. "\n"
end
I tried
print({"test","test2"})
But that just passes one argument (the table) to the function
{...}instead ofarg.