Quote:and invoke Foo, such as:
function Foo() return 1 end print("Executed");
lua_getglobal(L, "Foo");
/* call the function with 0 arguments, return 1 result */
if(lua_pcall(L, 0, 1, 0) != 0)
{
std::string _sErr = lua_tostring(L, -1);
lua_pop(L, 1); // remove error message
throw(_sErr);
}
/* get the result */
int_ret;
GetLuaValue(_ret, L, -1);
lua_pop(L, 1);