[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Help needed calling Lua from my C function
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Thu, 14 Apr 2005 18:12:08 -0300
> The error function myError doesn't get called.
>
> lua_pushcfunction(L,myError);
> lua_setglobal(L,"_ALERT");
Lua 5.1 no longer uses _ALERT. The correct idiom is something like
if (luaL_loadfile(L,"test.lua") || lua_pcall(L,0,0,0))
fprintf(stderr,"%s\n",lua_tostring(L,-1));
This also holds for 5.0, though _ALERT was still available for
compatibility only.
--lhf