User`s manual

Select Case statement is used for selecting one of several available branches in the
program course. It consists of a selector variable as a switch condition, and a list
of possible values. These values can be constants, numerals, or expressions.
Eventually, there can be an else statement which is executed if none of the labels
corresponds to the value of the selector.
Proper declaration of case statement is:
select case Selector
case Value_1
Statements_1
case Value_2
Statements_2
...
case Value_N
Statements_n
end select
where selector is any variable of simple type or expression, and each Value_x is
one of the following: a numeral, a declared constant, or an expression.
Case statement can have a final else clause:
select case Selector
case Value_1
Statements_1
case Value_2
Statements_2
...
case Value_N
Statements_n
case else
Statements_else
end select
As soon as the case statement is executed, at most one of the statements state-
ments_1 .. statements_n will be executed. The Value which matches the selector
determines the statements to be executed.
If none of the Value items matches the selector, then the statements_else in the else
clause (if there is one) are executed.
mikroBASIC
- Basic Compiler for Microchip PIC microcontrollers
88
mikroBASIC
MikroElektronika: Development tools - Books - Compilers
making it simple...
page
Select Case Statement