lua-users home
lua-l archive

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


>The following C code never executes the code inside the condition
>    lua_getglobal(lua, "name");
>    if(lua_istable(lua, 1)){
>        // this code never executes
>    }

Try -1 instead of 1. Very likely you already have things on the stack, and
the 1 points to the bottom of the stack while -1 points to the top, which
is where lua_getglobal leaves the value of "name".
--lhf