
384
|
Chapter 12: The Language Reference
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
Usage at a Glance
Type parameters added with the Of keyword cannot be used with Common Language
Specification (CLS) compliant components.
Version Differences
Generics and the Of keyword are new with Visual Basic 2005.
See Also
Class...End Class Statement, Delegate Statement, Function Statement, Interface...End
Interface Statement, Structure Statement, Sub Statement
On Error Statement
On Error { GoTo { label | 0 | -1 } | Resume Next }
label (required, unless 0 or -1 used)
A valid label within the procedure
Description
The On Error statement enables or disables error handling within a procedure. Error
handling is performed either by using a
Try...Catch...Finally statement or with an On
Error
statement. The On Error statement has several variations.
On Error GoTo label
When an error occurs, execution continues within the procedure at the line
marked with
label.AResume statement can be used within that block of code to
return to the errant section of code.
On Error GoTo 0
Disables error handling in the current procedure. This is the same as if no error
handlers were ever enabled in the procedure in the first place.
On Error GoTo -1
Used inside of an error handler to make the code forget that it is inside of an error
handler. It says, “Forget that the error ever ...