lua function and undefined number of argument ?
Posted: Sun Apr 24, 2016 4:14 pm
Hi,
I just wonder if the LUA used by factorio supports function with undefined number of arguments like in this référence (réf : https://www.lua.org/pil/5.2.html)
Because it does not seem to work with me ("attempt to call a nil value"), so I wonder if I miss something or...
I just wonder if the LUA used by factorio supports function with undefined number of arguments like in this référence (réf : https://www.lua.org/pil/5.2.html)
Code: Select all
printResult = ""
function print (...)
for i,v in ipairs(arg) do
printResult = printResult .. tostring(v) .. "\t"
end
printResult = printResult .. "\n"
end