|
Am 26.06.2013 17:06 schrieb "Daniel Barna" <daniel.barna@cern.ch>:
>
> Hi, I have a function which return a list of variables:
> function some_function()
> return a,b,c,d;
> end
>
> I would like to write this to a file, using a whitespace as the separator, something like this:
> some_file:write(some_function());
>
> How can I do this?
> Thank you
> Daniel
>
How about this:
function concat(sep,...)
local t = {}
for i=1,select('#',...) do
t[i] = tostring(select(i,...))
end
return table.concat(t,sep)
end
function test() return 1,nil,2,nil,nil end
print(concat(", ",test()))