Error Statement

Signal or rethrow an error condition.

Syntax

Error [integer-exp [, string-exp] ]

Comments

This statement allows user code to signal an error condition. The optional integer-exp is the error number, which can be the same as an ATEasy error number or it can be a user-defined application specific error number must be different than zero. The optional string-exp is the error message. Error-handling code (Catch block or OnError event) can retrieve the error number and message by calling the internal library routines GetErrorNum and GetErrorMsg.

An Error statement with no parameters re-throws the current error condition. This form of the Error statement is only valid in error handling code. It is used when the current error-handling code decides that it cannot handle the error condition and wants to pass it on to the next appropriate block of error-handling code, that is, an outer Try block with a matching Catch statement or the next OnError event.

Example

If nStatus<0 Then

Error 1234, "Invalid number of dimensions"

Endif

See Also

Try, OnError Event, Error Events