Anonymous
public cpp v1 · immutablebool dofile(lua_State* L,const char* str){ int err = luaL_loadfile(L,str); if (err == LUA_ERRSYNTAX) { cout<<"Syntax error in ["<<str<<"] :"<<getErr(L)<<std::endl; return false; } err = lua_pcall(L,0,0,0); if (err == LUA_ERRRUN) { cout<<"Runtime error in ["<<str<<"] :"<<getErr(L)<<std::endl; return false; } if (err != 0) { cout<<"Unknown error!"<<std::endl; return false; } return true;}