ErrObject Class

 <  Day Day Up  >  

An instance of the ErrObject class is returned by the Err function of the Information module. The ErrObject class represents the last exception caught by an On Error statement or by a Try statement.

 Public Sub Clear() 

The Clear subroutine clears all information about the last exception.

 Public Property Description() As String 

The Description property provides a text description of the last exception. If no description was supplied for the last exception, the result (if any) of the ErrorToString function will be returned.

 Public ReadOnly Property Erl() As Integer 

The Erl property returns the number of the last numeric label before an exception occurred.

Compatibility

The Erl function is provided only for backward compatibility and should not be used. The method System.Exception.StackTrace provides more comprehensive information about where an exception occurred.


 Public Function GetException() As System.Exception 

The GetException function returns the underlying System.Exception instance of the last exception.

 Public Property HelpContext() As Integer 

The HelpContext property provides the help context ID of the last exception.

 Public Property HelpFile() As String 

The HelpFile property provides the help file of the last exception.

 Public ReadOnly Property LastDllError() As Integer 

The LastDllError property returns the Win32 error code, if any, set by the last call to a Declare statement.

 Public Property Number() As Integer 

The Number property provides the error number of the last exception.

Compatibility

Error numbers are provided only for exceptions that have equivalent numbers in previous versions of Visual Basic. New exceptions will return the general error number 5. In general, error numbers should not be used in Visual Basic .NET.


 Public Sub Raise(ByVal Number As Integer, _   Optional ByVal Source As Object = Nothing, _   Optional ByVal Description As Object = Nothing, _   Optional ByVal HelpFile As Object = Nothing, _   Optional ByVal HelpContext As Object = Nothing) 

The Raise subroutine throws a new exception.

Compatibility

The Raise function is provided solely for backward compatibility. The Throw statement is the preferred way to throw exceptions.


 Public Property Source() As String 

The Source property provides the name of the object or application that caused the last exception.

 <  Day Day Up  >  


The Visual Basic .NET Programming Language
The Visual Basic .NET Programming Language
ISBN: 0321169514
EAN: 2147483647
Year: 2004
Pages: 173
Authors: Paul Vick

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