I was using luaL_loadbuffer to execute scripts loaded from a file, with
good results, excepting that I couldnt use comments because all file was
passed as a single line.
So, i tried to change the code to use luaL_loadfile:
if (filename.length() > 0) {
int error = luaL_dofile(luaVM, filename.c_str())
|| lua_pcall(luaVM, 0, 0, 0);
if (error) {
cout << lua_tostring(luaVM, -1) << endl;
lua_pop(luaVM, 1);
}
}
But this causes a lot of errors on script that worked perfectly with
previous version. What am I doing wrong here?