Sign in to follow this  
mandrav

Error info?

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this