This format of the @IF statement can be used in EDT procedures and in L mode to check whether EDT or DMS errors have already occurred. Depending on the result, a specified string either is or is not processed as input.
EDT errors may occur, for example, if an incorrect EDT statement is entered. The DMS error switch can be set for statements which access files (e.g. @WRITE, format 1) or may indicate system access errors.
Operation | Operands | L mode |
@IF | {ERRORS |
ERRORS | The condition is fulfilled if the EDT error switch is set. |
NO ERRORS | The condition is fulfilled if the EDT error switch is not set. |
DMS ERRORS | The condition is fulfilled if the DMS error switch is set. |
NO DMS ERRORS | |
The condition is fulfilled if the DMS error switch is not set. | |
text | EDT statement or data line. If the condition is fulfilled, the string is treated The If |
Note
If a specific statement is to be checked then the error switch must be reset before the relevant statement (see @RESET). Otherwise the @IF statement may return an unwanted result since earlier statements may have already set the EDT or DMS switch.
The @IF ERRORS statement should not be used to query hits after @ON. @IF format 3 should be used for this.
Using @IF with @RETURN as a statement outside of procedures may cause EDT to terminate (see the @RETURN statement).