IF Blocks permit conditional execution of a part of program.
Syntax:
IF( ) THEN | ||
ELSEIF( ) THEN | ||
ELSE | ||
END IF |
Both ELSEIF and ELSE are optional. There can be any number of ELSEIF branches.
First the IF-s ession is evaluated, and if .TRUE. the statements in the are executed and control is then transferred to the first statement following END IF. If .FALSE., the ELSEIF-s essions are evaluated succesively, until the first one is found to hold .TRUE. Then the corresponding statements are executed.
If none of the ELSEIF-s essions is found .TRUE., the ELSE branch is taken (if present). If the ELSE branch is not present the control is transferred to the first instruction after END IF.