Section 9. Program Control Instructions
9-20
clause, only the statements following the first match are
executed.
Case
Sets apart a group of CRBasic statements to be executed if
an expression in
expressionlist
matches
testexpression
.
expressionlist
The
expressionlist
consists of a comma-delimited list of one
or more of the following forms.
expression
expression To expression
Is compare-operator expression
statementblock
Elements
statementblock-1
to
statementblock-n
consist of
any number of CRBasic statements on one or more lines.
Case Else
Keyword indicating the
statementblock
to be executed if no
match is found between the
testexpression
and an
expressionlist
in any of the other
Case
selections. When
there is no
Case Else
statement and no expression listed in
the
Case
clauses matches
testexpression
, program execution
continues at the statement following
End Select
.
End Select
Ends
the
Select Case
. Must appear after all other statements
in the
Select Case
control structure.
The argument expression list has these parts:
Part Description
expression
Any numeric expression.
To
Keyword used to specify a range of values. If you use the To
keyword to indicate a range of values, the smaller value must
precede To.
Although not required, it is a good idea to have a
Case Else
statement in your
Select Case
block to handle unforeseen
testexpression
values.
You can use multiple expressions or ranges in each
Case
clause. For example,
the following line is valid:
Case
1
To
4, 7
To
9, 11, 13
Select Case
statements can be nested. Each
Select Case
statement must have a
matching
End Select
statement.
Select Case Statement Example
The example uses Select Case to decide what action to take based on user
input.
Содержание CR9000
Страница 6: ...CR9000 Table of Contents iv This is a blank page ...
Страница 22: ...CR9000 Overview OV 16 This is a blank page ...
Страница 26: ...Section 1 Installation 1 4 CR9000 FIGURE 1 1 3 CR9000 Battery Pack ...
Страница 72: ...Section 3 CR9000 Measurement Details 3 28 This is a blank page ...
Страница 88: ...Section 5 Program Declarations 5 6 This is a blank page ...
Страница 217: ...This is a blank page ...