Re: write a list of variables to a file, formatted
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: write a list of variables to a file, formatted
- From: Philippe Lhoste <PhiLho@...>
- Date: 2013年6月26日 16:54:05 +0200
On 26/06/2013 16:45, Daniel Barna wrote:
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());
> lua52
Lua 5.2.0 Copyright (C) 1994-2011 Lua.org, PUC-Rio
> f = function () return 1, 2, 3, 4 end
> print(f())
1 2 3 4
> print(table.concat(table.pack(f()), " "))
1 2 3 4
--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --