Err.Number Property


Err.Number Property

Class

Microsoft.VisualBasic.ErrObject

Syntax

     Dim result As Integer = Err.Number 

Description

The Number property gets or sets the numeric error code for the active error.

Usage at a Glance

  • When a runtime error occurs, the Number property is automatically assigned the numeric code of the error.

  • While you can assign the Number property directly, the Err.Raise method is a better way to assign the values of a custom error.

  • Many COM and OLE errors include an OLE-specific error flag in the error code. Use the following code snippet to get the true error code after an OLE-related error.

         Dim trueError As Integer     If ((Err.Number And vbObjectError) = vbObjectError) Then        trueError = Err.Number - vbObjectError     End If 

See Also

Err Object, Err.Description Property, Err.Source Property




Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net