lua-users home
lua-l archive

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


>No. LUA_GLOBALSINDEX is a pseudo-index where the global environment
>lives. For an "automatic" replace you can use
>
>lua_pushvalue(lua, LUA_GLOBALSINDEX)
>
>But, more often than not, you do not need to push it on the stack to
>use it.

Okay, so if I want to get the global table, I should do:

lua_pushvalue( lua, LUA_GLOBALSINDEX );
lua_gettable( lua, -2 );

?

Thanks,

Brian