Instructions

207 C-Control Pro IDE
© 2013 Conrad Electronic
End Case
The value of the Expression is calculated. Then the program execution will jump to the first constant
comparison that can be evaluated as true and will continue the program from there. If no constant
comparison can be fulfilled the Select Case construct will be left.
For constant comparisons special comparisons and ranges can be defined . Here examples for all
possibilities:
Comparison
Execute on
Constant, = Constant
Expression equal Constant
< Constant
Expression smaller Constant
<= Constant
Expression smaller equal Constant
> Constant
Expression greater Constant
>= Constant
Expression greater equal Constant
<> Constant
Expression unequal Constant
Constant1 To Constant2
Constant1 <= Expression <= Constant2
The new features that allow to use comparisons are introduced for Select Case statements with
IDE version 1.71. This extension is not available for CompactC switch statements.
The execution of a Select Case statement is highly optimized. All values are stored inside a
jumptable. Therefore exists a constraint that the calculated Expression is of type signed 16 Bit In-
teger (-32768 .. 32767). For this reason a e.g. "Case > 32767" is rather senseless.
Exit Instruction
An Exit will leave the Select Case instruction.
If an Else is defined within a Select Case instruction then the instructions after Else will be ex-
ecuted if no constant comparison could be fulfilled.
Example:
Select Case a+2
Case 1
b=b*2
Case = 5*5
b=b+2
Case 100 And &Hf
b=b/c
Case < 10
b=10
Case <= 10
b=11
Case 20 To 30
b=12
Case > 100
b=13