Something
public cpp v1 · immutablevoid lua::dostring(const char* str){ int err = luaL_loadstring(L,str); if (err == LUA_ERRSYNTAX) { cout<<"Syntax Error in: ["<<str<<"] :"<<this->getError(); return; }else if (err = LUA_ERRMEM) { cout<<"Memory error?"; return; } //now we call the function err = lua_pcall(L,0,0,0); if (err == LUA_ERRRUN) { cout<<"Runtime error in: ["<<str<<"] :"<<this->getError(); return; } if (err != 0) { cout<<"Unknown error"; }}