lua-users home
lua-l archive

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


>From lua-l@tecgraf.puc-rio.br  Mon Jan 17 17:36:39 2000
>From: "Thomas Tong" <toes@firestarters.org>
>
>The project I'm using LUA in with doesn't have stderr available. I've
>been able to get around it by changing the lua _ALERT function to write
>out to a log file instead.
>
>Rather than changing the LUA code I'd like to change _ALERT to map to
>my function instead. From reading the documentation, it appears that
>settagmethod would be the way to go.

No, you have to *redefine* _ALERT:

 lua_register("_ALERT",myFunction);

or, to expand this:

 lua_pushcfunction(myFunction);
 lua_setglobal("_ALERT");

Please tell us where the documentation misled you and we'll fix it.
--lhf