[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Table + LuaJava
- From: Jerome Vuarand <jerome.vuarand@...>
- Date: Tue, 9 Jun 2009 12:21:02 +0200
2009/6/9 Anselmo Junior <firstname.lastname@example.org>:
>> What java API/bindings are you using to access Lua?
> Its LuaJava: http://www.keplerproject.org/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 = "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.