[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: 4.1 work3 lua_getGlobal
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Sun, 20 Jan 2002 09:50:48 -0200
>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