EVALUATE |
|
|
The EVALUATE statement evaluates an I-type expression, trapping errors.
Format
EVALUATE var FROM i.type {THEN statement(s)} {ELSE statement(s)}
where
At least one of the THEN and ELSE clauses must be present.
The EVALUATE statement evaluates an I-type or correlative expression in much the same way as the ITYPE() function but allows the program using it to trap some error conditions. The statement takes the THEN clause if successful. It takes the ELSE clause if i.type is not a valid compiled expression. Note that this statement does not trap errors that occur in evaluating the expression.
Example
READ DICT.REC FROM DICT.F, 'SALE.VALUE' THEN EVALUATE SALE FROM DICT.REC ELSE DISPLAY 'SALE.VALUE is not a compiled expression' END END
|