Description |
The Else keyword is part of the If, Case and Try statements. It is used to start the section of code executed when earlier conditions are not satisfied.
See details of each of these statements for further details.
|
|
Related commands |
Case |
|
A mechanism for acting upon different values of an Ordinal |
End |
|
Keyword that terminates statement blocks |
If |
|
Starts a conditional expression to determine what to do next |
Then |
|
Part of an if statement - starts the true clause |
Try |
|
Starts code that has error trapping |
|
|
|
Example code : Illustrate various uses of the else clause |
begin // Note the lack of a ';' after the 'then' clause
if False
then WriteLn('True')
Else WriteLn('False');
// Nested if statements - Delphi sensibly manages associations
if true then
if false then
WriteLn('Inner then satisfied')
Else
WriteLn('Inner else satisfied')
Else
WriteLn('Outer else satisfied')
end;
|
Show full unit code |
False
Inner else satisfied
|
|