lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index] wrote:
Thanks for the explanation, but I'm still having some trouble understanding
this. My problem is, that everytime I get what I believe to be an error in a
lua script, the program exits, without issuing an error message at all. This
is using lua_call. Is this the correct behaviour? In 4.0, if I remember
correctly, a message was sent to stdout, or _ALERT. I suppose I should use

Yes, use lua_pcall if you need to catch errors when calling lua code.
(Actually I think it is better to say: "use lua_call only if you don't
need to catch errors, that is if you are in a C-function called
from pcalled Lua-code")

I'm trying to use loadfile, from lauxlib, but the only one I see is called
luaL_loadfile. Is this the same as the one indicated below? Also, is there a
reference for lauxlib somewhere?

lauxlib contains lua_dofile which is there for 4.0 compatibility (I guess),
It also does call global function _ALERT on errors.