lua-users home
lua-l archive

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


On 5/10/06, Turgut Hakkı ÖZDEMİR <> wrote:

// --- Start crying here --------------------------
int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
int nCmdShow)
    lua_State *L = lua_open();

    luaL_loadfile(L, "test.lua");

    lua_register(L, "msg", msg);

    lua_call(L, 0, 0); // when i use lua_pcall instead of lua_call here,
surrounded with error handling functionality it complains about nil values


    After loading the test.lua file, you must run it because it's
just a function on the stack at this point. After running it your
declarations will have effects.