lua-users home
lua-l archive

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


lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_GLOBALS);
for (lua_pushnil(L); lua_next(L, -2); lua_pop(L, 1)) {
}
lua_pop(L, 1);

[I'm partial to the for loop construction myself.]

On Mon, Nov 19, 2012 at 3:16 AM, Joop Boonen <joop_boonen@web.de> wrote:
> Hi,
>
> Does anyone which alternative Lua 5.2 code can be used for:
>
> while (lua_next(L, LUA_GLOBALSINDEX) != 0) {
>
> Is the following an option?
>
> while (lua_next(L, LUA_RIDX_GLOBALS) != 0) {
>
> Regards,
>
> Joop.
>
>



-- 
- Patrick Donnelly