lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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?


--
http://dsgp.blogspot.com | Linux, programación, juegos
Have no place I can be since I found Serenity
But you can’t take the sky from me


		
______________________________________________ LLama Gratis a cualquier PC del Mundo. Llamadas a fijos y móviles desde 1 céntimo por minuto. http://es.voice.yahoo.com