Error$ Function

Returns the error message that corresponds to a given error number.

Syntax

Error$([errornumber])

The optional errornumber argument can be any valid error number. If errornumber is a valid error number, but is not defined or errornumber is not valid, Error returns the string "Undefined internal error". If errornumber is omitted, the message corresponding to the most recent run-time error is returned.

Example

This example uses the Error function to print error messages that correspond to the specified error numbers.

Dim ErrorNumber
For ErrorNumber = 1 To 99   ' Loop through values 1 - 99.
   Trace Error(ErrorNumber)   ' Print error to Output window.
Next ErrorNumber

 

See Also

Erl Function , Err Function , Trappable Errors