If...Then...Else statement


SYNTAX:
if_stmt = IF logical_expression THEN stmt { stmt } [ ELSE stmt { stmt } ]  END_IF ';' .
logical_expression = expression .
The if...then ...else statement allows for conditional execution of statements based on an expression of type logical . When the logical_expression evaluates to true the statement following then is executed. When the logical_expression evaluates to false or unknown the statement following else is executed, if the else clause is present. If the logical_expression evaluates to false or unknown and the else clause is omitted, control is passed to the next statement.
example:
IF a < 10 THEN
 c :=c + 1;
ELSE
 c :=c - 1;
END_IF;