OnErrorGosub()
Syntax
OnErrorGosub(@Procedure())Description
If an error occurs, your program will be redirected to the procedure in the parameter list.
Example:Procedure ErrorHandler() v=MessageRequester("An error happened...","Continue with the program?",20) If v=7 End EndIf EndProcedure OnErrorGosub(@ErrorHandler()) ; We do a division by zero here, this will normally be catched from ; the PB debugger. So deactivate it, to test this error handler. a = 0 b = 1 c = b / a ; this will force the ErrorHandler() procedure MessageRequester("Info","Normal end") End
Supported OS
Windows