92
Language Reference
©2000-2008 Tibbo Technology Inc.
Syntax:
select select_expression
case expression1_1 [ , expression1_2, … ] [ : ]
statement1_1
statement1_2
…
case expression2_1 [ , expression2_2, … ] [ : ]
statement2_1
statement2_2
…
…
[ case else [ : ]
statementN_1
statementN_2
…
]
end select
Scope:
Local and HTML
See Also:
Part
Description
select_expression
Required. The expression which is evaluated first;
subsequent expressions are tested to match this
expression. If a match is found, the statements contained
within this case clause are executed, and execution then
resumes from the line immediately following end select.
expression[1_1...
N_1]
Required. An expression to evaluate; If it matches the
select_expression, the statements included in this case
clause are executed.
statement[1_1...
N_1]
Required. Statements to execute when expression[1_1...
N_1] matches select_expression.
:
Optional. Maintained for backwards compatibility -- some
versions of BASIC in the past required a colon following
every case expression.
case else
Optional. Precedes a block statements which is executed if
neither of the earlier case clause match the
select_expression. If present, must be the last case clause.
Details
It is of note that once a matching case clause is found, no other case clauses are
tested; the code within the matching clause is simply executed, and execution
resumes from the line following end select.
Also, remember that writing two select_expressions at the same time does not
mean that there will be a shared code for both of them. Rather, it means that the
first expression will have no code associated with it!
89