lua-users home
lua-l archive

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


Well, I use my own simplified interface for lua API with a bit different
names and arguments in my program, so just pasting the real code may be
only confusing. However, what it does (when my macros are expanded) is
just what I wrote in the sample code.

There is no loop. Say, there are three variables in the lua file:

a = 1
b = 2
c = 3

and in the C file I call that code 3 times with name="a" or "b" or
"c" (but not in a loop).

The problem arises only if some of the three params is missing in the
lua file, so that lua_getglobal pushes nil for it.

---

LUA_USE_APICHECK means to build my own lua with -DLUA_USE_APICHECK ?

Thank you,

JS

> Can you provided a complete example which displays this problem, it
> seems like there is something more going on.
> >and ready for another lua_getfield request,
> 
> Suggests that this maybe inside a loop.
> 
> >lua_gettop gives -1 (in subsequent use it says -2 ...)
> 
> Suggests that you are using an invalid index, have you tried turning
> LUA_USE_APICHECK on?
> 
> --Liam
>