IF construct

A simple form for the IF construct is:

 IF(logical_expression) THEN

  statement_block 1


  statement_block 2 ]


The ELSE section is optional. If the logical expression is true, the first block is executed, otherwise the second.

For example:






Logical expressions are formed using relational operators and logical operators knowing their order of precedence.

Logical expressions can be stored as mLOGICAL variables.

If the ELSE section consists of one IF construct, then ELSE and IF can be reduced to ELSEIF provided that one of the associated ENDIFs is deleted. Sometimes it is simpler to use a CASE construct.

IF constructs can be named. Optionally, the same name may be used after ELSE and after ELSEIF (expr) THEN.



Copyright © 1999-2023 Silverfrost Limited