...
int start_index = lua_gettop( spGlobalState );
lua_pushstring( spGlobalState, "loadstring" ); // function name
lua_gettable( spGlobalState, LUA_GLOBALSINDEX ); // function to be
called
lua_pushstring( spGlobalState, command.c_str() ); // parameter
lua_call( spGlobalState, 1, 1 ); // call function
with 1 arguments and 1 result
lua_call( spGlobalState, 0, LUA_MULTRET ); // call function
with 0 arguments and variable results
int end_index = lua_gettop( spGlobalState );
...
I'm expecting end_index - start_index to be 3 since Test() returns 3 values,
but it's allways zero.
I'm sure I'm missing something simple...