Previous topic |
Next topic |
Ada Home Page |
Index
If-then-else statements
An if-then-else statement is needed when the
program specification indicates alternative actions.
- true alternative choice between sets of statements
Statement form
statement_before;
if test then
statements(s)_1;
else
statements(s)_2;
end if;
statement_after;
An example program
traces the development of a program that requires an if-then-else
statement.
Statement semantics
Layout convention
- statements inside if indented by fixed amount
- statements inside begin - end indented by same
Previous topic |
Next topic |
Ada Home Page |
Index
c-lokan@adfa.oz.au / 13 Feb 96