Error Routines

Smee

Well-Known Member
Licensed User
Longtime User
Hi,

When an error is trapped is there a way to determine which line the error occured on and resume execution at a specified place?

Thanks
 

agraham

Expert
Licensed User
Longtime User
You can't find the line directly but if you can put more than one ErrorLevel statement in your Sub vectoring to different labels to more precisely locate where the error occurred. Using B4PObject(6) and the Door library or my http://www.b4x.com/forum/additional-libraries/2305-exceptions-handling-library.html#post12486 you can find out more details of the error. The help for the Exceptions library has a topic on error handling in Basic4pppc.

The default exception handling in an optimised compiled program does not show the error line. For debugging my http://www.b4x.com/forum/additional...-legacy-optimised-applications.html#post27120 includes a DebugRecompiler which can give the error line but you wouldn't use if for the final application because of the performance hit.

You can't resume after an Exception.
 

Smee

Well-Known Member
Licensed User
Longtime User
Many thanks for the reply.

i know what will cause the error i am trapping for.
I am currently using a goto as a "resume next" but i wanted it a little more sophisticated in case of another error being triggered

Maybe error level improvements in the wishlist?

Thanks again
 
Top