Apparently after some update, the ... in a lua function does not seem to be stored into the arg table anymore?
Example:
So add(1, 2, 3, 4, 5, 6, 7, 8, 9)Will result an error
bad argument #1 to 'ipairs' (table expected, got nil)
Lua doesn't take ... as args?
Example:
Code:
function add(a, b, ...)
local sum = a + b
for i,v in ipairs(arg) do
sum = sum + v
end
print("Sum = " .. sum)
end
Quote:
bad argument #1 to 'ipairs' (table expected, got nil)
0 commentaires:
Enregistrer un commentaire