The read-only system variable ERR contains a value corresponding to the last error encountered. When the system is started, ERR has the value 0. Other values (adapted from the help file) are:

1: Syntax Error. There is problematic grammar in the program.

2: Out of range. The value exceeds the valid range.

3: Out of memory. There is insufficient memory available.

4: Undefined label. The destination for a branch instruction cannot be located.

5: NEXT without FOR. There is a NEXT command which does not belong to any FOR command.

6: Out of DATA. There is insufficient DATA available for a READ command.

7: Illegal function call. There is a problem with the assignment of elements in a function or command.

8: Duplicate definition. The same array or variable has been defined more than once.

9: Can't continue. A program cannot be continued using a CONT command.

10: Missing operand. There are insufficient parameters.

11: Duplicate label. The same label has been defined more than once.

12: Illegal resource type. The resource type designated by a string does not exist.

13: Illegal character type. The designated character type does not exist.

14: String too long. The string is too long. Labels should be no longer than 8 characters, while strings should be no more than 256 characters in length.

15: Division by zero. A number has been divided by zero.

16: Overflow. The results of an operation have exceeded the permitted range.

17: Subscript out of range. The subscript for an array variable is out of range.

18: Type mismatch. Variable types do not match.

19: Formula too complex. The formula may have too many bracketed sections, or otherwise be too complex.

20: RETURN without GOSUB. A RETURN command is present without an accompanying GOSUB command.

21: FOR without NEXT. A FOR command is present which does not correspond to a NEXT command.

22: Illegal MML. There is an error in the MML.

This system variable is often used in conjunction with ERL.