lua-users home
lua-l archive

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


>Can someone point me at the best way to save
>and restore globals in Lua4 from C code?
>
>     save globals
>     do script
>     restore globals

Something like this:
	lua_getglobals(L);
	lua_newtable(L);
	-- fill this newtable with whatever you want
	lua_setglobals(L);
	-- do script, remove any returns
	lua_setglobals(L);
--lhf