GetErrorNum Procedure

Returns the current run-time error number.

Syntax

[ lError = ] GetErrorNum( )

The GetErrorNum procedure syntax has the following parts:

 

Name

Type

Description

lError

Long

Error number

Comments

This function can be used only when a non-fatal and recoverable run-time error occurred and the OnError event procedure was called or inside a catch clause within a Try statement. Otherwise, the function returns 0.

Example

The following example demonstrates how to retry a specific error (Error 93) three times.

OnError()

{

If GetErrorNum( ) = 93 Then

! instrument not responding

iRetries=iRetries+1

If iRetries < 3 Then

Retry ! retry 3 times

Endif

iRetries=0

Ignore ! ignore it

Else

Return ! default error message

Endif

}

See Also

Abort, GetErrorMsg, Ignore, Pause, Retry, Try