lua-users home
lua-l archive

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

Hello folks,

I'm new in Lua and i need some help with tables in lua and java interchange

In Lua script I made like that:

function init()
    local t = {}
    t[03] = "3"
    t[11] = "19"
    t[12] = "25"
    return trn

And java I made:

    public void test() {
        state.getGlobal("init");, 1);
        LuaObject lo = state.getLuaObject(1);
        try {
        } catch (LuaException e) {

"state" is a LuaState object that have been instanciate in Class Constructor.
"lo" returned a Lua Table, but if I pass getField("03") returned nil value

But i really need get not only the value of the table, but the keys too... because the keys will be random. Get the table's keys in java code it is possible?

I will appreciate if anyone could help me...