RE: calling a function who's name is stored in a lua table
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: RE: calling a function who's name is stored in a lua table
- From: "Alexander Altshuler" <alt@...>
- Date: 2010年1月12日 14:08:18 +0300
On 12/01/10 10:50, sean farrow wrote:
[...]
> Now if I know the value of the number of the function in the table I
wish
> to call (x) how can I call this without iterating through the
> table-essentially is there a way of finding a value in a table given
it's
> key?
function a()
print"a"
end
function b(arg)
print(arg)
end
t = { "a","b" }
_G[t[1]]()
_G[t[2]](123)
Regards
Alexander Altshuler