Skip to content

CLEAR ERC

Clear Error Condition Variable

This directive resets the ERC system variable to 0, its initial value.

CLEAR ERC

You can use this directive in tandem with the ERC system variable. In general you will use ERC=numeric-value to specify an error code; after testing for the error, you can use CLEAR ERC to reset the value of ERC to 0.

This directive has no effect on the ERR system variable.

OPEN (1, ERC=3) "NOFILE"
IF ERC=3
PRINT ERC
CLEAR ERC

If NOFILE does not exist, the output will be 3. After CLEAR ERC is executed, the value contained in ERC will be reset to 0.

ERC system variable
SET ERC directive

From the Thoroughbred Basic Language Reference, Volume I: A–E, version 8.9.1. Open this page in the PDF