lua-users home
lua-l archive

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


Gang,

I have a table "MessageTable" that is used in various different way. That is, it has different fields depending on is use at a moment. Thus, since I don't want stray values to remain in the table for whomever may use it next, I'm currently setting the table to nil, then creating it from scratch:

	lua_pushstring(itsLuaState, "MessageTable");
	lua_pushnil(itsLuaState);
	lua_settable(itsLuaState, LUA_GLOBALSINDEX);

	lua_pushstring(itsLuaState, "MessageTable");
	lua_newtable(itsLuaState);
	lua_settable(itsLuaState, LUA_GLOBALSINDEX);

I'd rather just empty its contents. Is there a fell swoop way to do so without iterating over the table? Something equivalent to

MessageTable = {}

Just looking for the most efficient way of doing things...

thx,
ando