.BG
.FN switch
.TL
Evaluate One of Several Expressions
.CS
switch(EXPR, ... )
.AG EXPR
any S object; used to choose
which of the remaining arguments to evaluate
.AG ...
one of these arguments (at most) will be evaluated, and returned as
the value of `switch'
.RT
`switch' evaluates its first argument.
If the value is of mode character, the function looks among the names of
the remaining arguments for one that exactly (not partially) matches the
character string (only using the first element of the value).
If there is a match, the corresponding argument is evaluated and returned
as the value of `switch'; otherwise the first unnamed argument is evaluated
and returned.
.PP
If the first argument is not character, it is coerced to integer;
if it is in the range 1 to `nargs()-1', then the corresponding argument
from the `...' is evaluated and returned as the value of `switch'.
.PP
If no selection is made, `switch' returns `NULL'.
.KW programming
.WR
