Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))

ErrorToString Function

Class

Microsoft.VisualBasic.Conversion

Syntax

Dim result As String = ErrorToString([errorNumber])

errorNumber (optional; Integer)

A numeric error code

Description

The ErrorToString function returns the error message or description corresponding to a particular error code. If no error code is supplied, the message for the most recent runtime error is returned instead; this is generally the same as the Err.Description property.

Usage at a Glance

  • If no error code is supplied, and there have been no runtime errors, a blank string is returned.

  • If the supplied error code is not recognized as a valid error, a generic message indicating an application-specific error is returned.

See Also

Err.Description Property

Категории