lua-users home
lua-l archive

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

2009/6/9 Anselmo Junior <>:
>> What java API/bindings are you using to access Lua?
> Its LuaJava:
>> Here you are trying to get a string key "03" from a table that only has
>> numeric keys.  I don't know what Java API you are using to access Lua, but
>> there should be a way to get numeric keys from the table.
> In LuaJava, the LuaState object has the same methods that is in C. If you
> know how to do is in C, i think we can do it with LuaState in java.
> I try replace in lua script the line "t[03] = "3"" for "t["03"] = "3"" and
> really work, i get the number "3" (the value of key "03"), but i'd like to
> use numeric keys.

The problems seems to be in LuaJava. The getField method of the
LuaObject class should take a LuaObject as parameter, not a String.
AFAICT you cannot use numeric keys with LuaJava.