lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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