next up previous contents index
Next: The Repeat..until statement Up: Statements controlling program flow. Previous: The Goto statement

The If..then..else statement

The If .. then .. else.. prototype is:

If Expression1 Then Statement1;

or 

If Expression2 then 
   Statement2
else
   Statement3;
Be aware of the fact that the boolean expressions Expression1 and Expression2 will be short-cut evaluated. (Meaning that the evaluation will be stopped at the point where the outcome is known with certainty)

Also, after Statement2, no semicolon (;) is alllowed.

All statements can be compound statements.


Michael Van Canneyt
Thu Sep 10 14:02:43 CEST 1998