Archived

This topic is now archived and is closed to further replies.

Redefining _ALERT in Lua

This topic is 5241 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I am using Lua in a Win32 environment, thus I don''t have access to an STDERR console. I have no way of seeing error messages from Lua. The documentation says that if I redefine _ALERT, I can change the way I see error messages. How can I do this? Thank you.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I am guessing you are using Lua 4 then, since in Lua 5 the error handling works differently. _ALERT is just a global variable. The standard library assigns a function to it that takes one string argument and prints this argument to STDERR. All you need to do is write your own _ALERT function after loading the standard libraries, and the standard _ALERT function will be overwritten by yours.

Share this post


Link to post
Share on other sites