6. Making decisions

To make decisions, a program has to determine wether a condition is
TRUE or FALSE.
This is done in a conditional statement, where
the program flow splits up in two "branches".

In this lesson, we'll talk about the IF statement.

The conditional statement IF - THEN - ELSE

What is the first decision to be made in procedure
ShowFromFootOrMeter?

If the first radiobutton is selected, then both of the edit boxes
for input must be visible. Also both of the labels above the edits must
be visible, the first one should show 'foot' and the second one should
show 'inch'.

If the second radiobutton is selected, then the second edit boxes
must be invisible. Only the first label must be visible and it should
show 'meter'.

If the first radiobutton is selected, then we must convert from
foot and inch to meter.

If the second radiobutton is selected, then we must convert from
meter to foot and inch.

Such a decision is made with an if-then-else statement:

if a_condition then statement else
another_statement;

Instead of following the word then by a single statement,
you may also follow it by a block of statements, nested between
the words begin and end. The same goes for the else
part.