I have a problem using implicit parameter argin functions.
The code does not work. The documentation http://www.lua.org/pil/5.2.html should work.
function listar_um (...)
for i,v in ipairs(arg) do
print("usando args " .. arg[i])
end
end
listar_um("Olรก", 1, "Dois")
This code works with a declaring variable lista.
function listar_um (...)
lista = {...}
for i,v in ipairs(lista) do
print("nรฃo usando args " .. lista[i])
end
end
listar_um("Olรก", 1, "Dois")
Why does the first example not work?
Script for the test: http://www.codeshare.io/IPwRJ
Run the on-line script: http://www.compileonline.com/execute_lua_online.php
Thank.
source
share