switch (expression-0)
{
case expression-1: [statements]
[case expression-2: [statements]]
...
[case expression-N: [statements]]
[default: statements]
}
expression-0 is compared with expression-1 ... expression-N.
As soon as a match is found, all subsequent statements within the switch
block are executed. The statements after default are executed if none of the
previous expressions was matched.
Within the statements, break is used to leave the switch block premature.
Note that unlike C, expression-1 ... expression-N don't have
to be constants.
|