lua-users home
lua-l archive

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


Hi, again.

All I nedd to know is how to push a table in the stack.
For example, I have the functions lua_pushnumber, lua_pushstring, etc.
How to make a "lua_pushtable"?

I have the address of the table(via lua_ref) and will use the 
lus_pushtable to put the table as a parameter.

int _table, _func;

int l_setevent(lua_State* L){

	_table = lua_ref(L, 1);
	_func = lua_ref(L, 2);
...
}

Then, to call the function

lua_getref(L, _func);
			
lua_pushtable(L, _table);
       
lua_call(L, 1);

lua_pop(L);

Is that possible?