ERR (function)
ERR Function
This numeric function returns a positive integer based on the value of the ERR system variable and that value’s position in a list of error values.
Syntax
Section titled “Syntax”ERR (error-list)error-list- is a list of error code numbers that are used to establish the value returned by this function.
Remarks
Section titled “Remarks”The integer value returned is determined as follows:
- If the value of the ERR system variable matches the first entry in error-list, this function returns a 1.
- If the value matches the second entry in error-list, this function returns a 2.
- If no match occurs between the ERR system variable and the error-list, this function returns a 0.
Examples
Section titled “Examples”ERR (0,12,34)returns the value 1 if an Error 0 is produced.
returns the value 2 if an Error 12 is produced.
returns the value 3 if an Error 34 is produced.
returns the value 0 if any other error is produced.
ON ERR(0,12,42) GOTO 1000, 2000, 3000, 4000
GOTO 1000 if ERR is NOT equal to 0, 12, or 42.GOTO 2000 if ERR=0.GOTO 3000 if ERR=12.GOTO 4000 if ERR=42.For more information on how to use this sample code please refer to the descriptions of the ON GOSUB and ON GOTO directives.
See also
Section titled “See also”ERR system variable
From the Thoroughbred Basic Language Reference, Volume I: A–E, version 8.9.1. Open this page in the PDF