lua-users home
lua-l archive

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


I have the following lua table:

AtcActions =


[0] = "AtcDoNothing",

[1] = "AtcSayCharacter",

[2] = "AtcSayWord",












The keys are numbers, the values in this case are the names of functions I wish to call.

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?

Once I have the value as a string, how do I invoke the function in the same script file with the values name?

Any help appreciated.