The $SELECT function returns a value associated with the first true truth-valued expression in a list of paired expression arguments.
The format for the $SELECT function is:
$S[ELECT](tvexpr:expr[,...])
$SELECT() evaluates expressions from left to right.
If a truth-valued expression is TRUE (1), $SELECT() returns the corresponding expression after the colon (:) delimiter.
Once $SELECT() finds a TRUE, the function does not process any remaining arguments.
If $SELECT() finds no TRUE truth-value in its list of arguments, the function generates a run-time error.
$SELECT() is one of a limited set of functions that permit an indefinite number of arguments. $SELECT() provides a means of selecting from a list of alternatives.
Generally, the last $SELECT() argument has numeric literal one (1) for a truth-value to prevent run-time errors, and to provide a "default" value.