All pastes #458851 Raw Edit

Anonymous

public cpp v1 · immutable
#458851 ·published 2007-04-26 03:46 UTC
rendered paste body
bool 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;}