3. Statements : OpenROAD Language Statements : If-Then-Else Statement : Variants—If-Then-Else Statement
 
Share this page                  
Variants—If-Then-Else Statement
The if-then-else statement has the following variants:
if-then-endif
The if statement tests for the truth of an expression. If the expression is true, OpenROAD executes the set of statements following the then keyword up to the endif statement. If the expression is false or null, OpenROAD executes the statements after the endif statement.
if-then-else-endif
If the expression in the if statement is true, 4GL executes the set of statements following the then keyword up to the else keyword. If the expression is false or null, OpenROAD executes the set of statements following the else keyword up to the endif keyword.
if-then-elseif-then-else-endif
If the expression in the if statement is true, OpenROAD executes the set of statements following the then keyword up to the elseif keyword. If the expression is false or null, then OpenROAD tests the expression that starts with the elseif keyword. If this expression is true, OpenROAD executes the set of statements up to the else keyword.
If both conditions are false or null, then OpenROAD executes the set of statements following the else keyword up to the endif keyword.