NAME
        switch - compact if-then-else selector

SYNOPSYS
        switch(<variable>)
        {
        case <case>:
            <code>; [<code>;]
          [ break;   or  /* fallthrough */ ]
        case <case>:
            <code>; [<code>;]
          [ break;   or  /* fallthrough */ ]
      [ default:
            <code>; ]
        }

DESCIPRION
        When you have a certain <variable> that you want to test with a number
        of different values, the switch-statement is a more compact way of
        writing if-else if-else if-else.

        It is possible to have multiple case: statements next to each other
        for multiple conditions that lead to the same <code>. At the end of
        the <code> there should be a break; statement to interrupt the switch.
        Otherwise it will continue with the <code> of the next <case> or
        ultimately the default.
        The default: is executed when none of the <case>s match (or when there
        is no break before it). Note that the default: is optional.

ARGUMENTS
        <case> - the <case> must be a constant. It may not be a variable or a
                 function call. It must be a single number or a range of
                 numbers with begin..end or a string.
        <code> - a line of code that is executed for each element. Note that
                 within the switch there is no need for { } . The code will
                 continue until the break statement.
        <variable> - an integer or string to test.

EXAMPLE
        switch(value)
        {
        case 3..6:
        case 10:
            write("3, 4, 5, 6 or 10.\n");
            break;
        case 7;
            write("7.\n");
            /* fallthrough */
        default:
            write("7 or something not captured yet.\n");
        }

SEE ALSO
        break