ERR() Function/Variable - Get Error as Integer

Syntax

ERR
ERR(int{,int...})

Description

The ERR() function does one of the following:

  • Returns the most recent error value as an integer in the 0 to 255 range. The ERR() value is automatically set to 0 by BEGIN, CLEAR, LOAD, RESET, RUN, and START.

  • Uses an argument list to return a position with the same value as the error value.

  • Parameter

    Description

    int

    Argument list. Each item in the list must evaluate to an integer from 0 to 255. PRO/5 scans the argument list and returns the position of the first argument with the same value as ERR(). If no such argument is found, a 0 is returned.

Examples

0100 IF ERR=2 THEN PRINT "END OF FILE"
0050 ON ERR(20,47,41) GOTO 1000,2000,3000

Branch to 1000 if the error is other than 20, 47, or 41.

Branch to 2000 if !ERROR=20.

Branch to 3000 if !ERROR=47 or 41.

See Also

List of Errors

Functions - Alphabetical Listing

Variables - Alphabetical Listing