EasyManua.ls Logo

Crestron SIMPL+ - Page 98

Crestron SIMPL+
374 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Software Crestron SIMPL+
®
88 z SIMPL+
®
Language Reference Guide - DOC. 5797G
<statements> blocks are only a single statement, the { and } characters on the CASE
may be omitted. If no condition is met in the CASE statements, the DEFAULT case,
if specified, is used.
CSWITCH has the restriction that the case statement only contains unique integer
constants. CSWITCH differs from SWITCH in that the operating system is able to
evaluate and execute the CSWITCH statement faster. Therefore, you should use
CSWITCH in place of SWITCH whenever unique constants are being evaluated.
Example:
ANALOG_INPUT AIN;
INTEGER X;
CSWITCH( AIN )
{
CASE (2):
{
X = 0;
break; // terminate this case statement block
}
CASE (3):
{
X = AIN;
// continue executing to next case statement block ==>
case(5)
}
CASE (5):
{
X = X + AIN + 1;
break;
}
DEFAULT:
{
PRINT(“Unknown command %d!\n”, AIN);
break;
}
}
In this example, if the value of AIN is 2, X is set equal to 0. If AIN is 3, X is set AIN
+ AIN + 1. If AIN is 5, X is set equal to AIN+1. If AIN is any other value, an error
message is printed.
Version:
SIMPL+ Version 3.00.05
Control System
2-Series Only

Table of Contents

Other manuals for Crestron SIMPL+

Related product manuals