lua-users home
lua-l archive

4.1 work3 lua_getGlobal

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


I'm a bit puzzled. I have a global table called 'name' defined with
name = {}
The following C code never executes the code inside the condition
 lua_getglobal(lua, "name");
 if(lua_istable(lua, 1)){
 // this code never executes
 }
while the following lua code works fine
 if type(name) == 'table' then
 // this code does run
 end
Obviously I'm doing something wrong in the C version but I can't see what it
is. It's likely to be the 1 in lua_istable, but why?
Haven't tried this with 4.0 yet.
Russ

AltStyle によって変換されたページ (->オリジナル) /