[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: 5.0 changes question
- From: Brian Hook <hook_l@...>
- Date: Thu, 6 Mar 2003 10:47:05 -0800
>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