else
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.
Example
Download This Source for Free Pascal
Var
int:Integer;
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');
int := 6;
case (int mod 2) of
0:Writeln('Zero');
1:Writeln('One');
Else Writeln('Not 1 or 0');
end;
end.
Output
False
Inner else satisfied
Zero
See Also
Case,
End,
If,
Then,
Try.