🎉 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!

Error info?

Started by
2 comments, last by WitchLord 18 years, 7 months ago
A quick one: If I have errors in my script, when calling Build() it returns asERROR. Is it possible to get the line number of the error? It is printed in the output stream but I want to know if I have access to this info. For example, consider a script debugger. You write a script, try to execute it and it contains errors. Can the app know the error line number to focus it in the editor? (I am *not* writing a debugger, just mentioning it as an example). Thanks.
Advertisement
Quote: It is printed in the output stream


Looks like you answered your own question.
Quote: Original post by Deyja
Quote: It is printed in the output stream


Looks like you answered your own question.


I don't consider myself *that* stupid, thank you.

I said I want to access the line number in code. Yes, I see it on the screen but I need my code to "see" it to open the script in an editor and position the caret on the error line.
The script engine doesn't store the line numbers where errors or warnings occurred. The best way to do it is to parse the error messages as they are written to the output stream. The message format is quite easy to parse so this shouldn't require much work from the application programmer.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement