[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Table + LuaJava
- From: Anselmo Junior <afajunior@...>
- Date: Tue, 9 Jun 2009 07:56:45 -0300
Oh yeah, and I recently try to do that and work. Only need get what key in the script is in use to get the values.
2009/6/9 Robert G. Jakabosky <email@example.com>
On Tuesday 09, Anselmo Junior wrote:Looks like LuaJava's API doesn't follow the Lua C API completely.
> 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.
Looking over the API docs for LuaJava I found this method in the LuaState
getLuaObject(LuaObject parent, java.lang.String name)
getLuaObject(LuaObject parent, java.lang.Number name)
getLuaObject(LuaObject parent, LuaObject name)
based on the description it looks like you pass the table object as
the "parent" parameter and the "name" parameter is the key you want.
LuaState seems to be a weird place for that method. I don't see why they
didn't put it in LuaObject.
Robert G. Jakabosky