[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Opposite of unpack?
- From: Michael Gerbracht <smartmails@...>
- Date: Thu, 17 Jul 2008 18:06:12 +0200 (MESZ)
Sorry for this really simple question but at the moment I can not find the
answer by myself although I think it's really simple. If I have a function
that returns more than one value - how do I get them into a table? I need
something like this:
function test()
result = some table of results
return unpack(result)
end
local t = {}
t = pack(test())
print(t[2])
Unfortunately there is no pack command, but I am sure it can be done
somehow. Please assume that I can't change the function itself, otherwise
the best solution would be to change the function to "return result" of
course ;-)
Thanks,
Michael
--
...using RiscLua 4.14, built from Lua 5.1.3