🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Redefining _ALERT in Lua

Started by
0 comments, last by Chocoboko 20 years, 10 months ago
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.
Advertisement
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.

This topic is closed to new replies.

Advertisement