Conditional structures: Difference between revisions

Content added Content deleted
Line 73:
When there is no '''when others''' clause, the compiler will complain about any uncovered alternative. This defends against a common reason for bugs in other languages. I.e., the following code is syntactically incorrect:
 
<lang ada>case Today inis
when Monday =>
Compute_Starting_Balance;
Line 85:
The syntactically correct version:
 
<lang ada>case Today inis
when Saturday | Sunday =>
null; -- don't do anything, if Today is Saturday or Sunday