Returns the current run-time error number.
[ lError = ] GetErrorNum( )
The GetErrorNum procedure syntax has the following parts:
Name |
Type |
Description |
lError |
Long |
Error number |
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.
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
}