9.0
212
Begin Dialog UserDialog 200,120
Text
10,10,180,30,"Please push the OK button"
OKButton 80,90,40,20
End
Dialog
Dim
dlg As UserDialog
Dialog
dlg ' show dialog (wait for ok)
End
Sub
On Error Instruction
Syntax
On Error GoTo 0
-or-
On Error
GoTo label
-or-
On Error
Resume Next
Group
Error Handling
Description
Form 1: Disable the error handler (default).
Form 2: Send error conditions to an error handler.
Form 3: Error conditions continue execution at the next statement.
On Error sets or disables the error handler. Each user defined procedure
has its own error handler. The default is
to terminate the macro
on any error. The Err object's properties are set whenever an error occurs. Once an error
has occurred and the error handler is executing any further errors will terminate the macro, unless the Err
object
has been cleared.
Note: This instruction clears the Err
and sets Error$ to null.
Example
Sub Main
On Error
Resume Next
Err
.Raise 1
Debug
.Print "RESUMING, Err=";Err
On Error
GoTo X
Err
.Raise 1
Exit
Sub
X: Debug
.Print "Err=";Err
Err
.Clear
Debug
.Print "Err=";Err
Resume
Next
End
Sub










