Jump to content
  • Advertisement

Archived

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

Chocoboko

Redefining _ALERT in Lua

This topic is 5489 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
Advertisement
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!