Cswitch - Crestron SIMPL+ Reference Manual

Language reference guide
Hide thumbs Also See for SIMPL+:
Table of Contents

Advertisement

Crestron SIMPL+
Language Reference Guide - DOC. 5797G
®

CSWITCH

Name:
CSWITCH
Syntax:
CSWITCH (<expression>)
{
CASE (<unique integer constant>):
[{]
<statements1>
[break;]
[}]
CASE (<unique integer constant >):
[{]
<statements2>
[break;]
[}]
[DEFAULT:
[{]
<statements>
[break;]
[}]
}
NOTE: In SIMPL+ v3.01.00 and later, the 'break' statement is required to terminate
the case statement block that it resides within. If no 'break' statement exists, the
program will continuing executing to the next case statement block or default
statement block.
NOTE: Many CASE statements may be used in the body of the CSWITCH.
Description:
CSWITCH is a more direct method of writing a complex IF-ELSE-IF statement. In
the CSWITCH, if <expression> is equal to a CASE's constant, then the statement
block for that CASE value is executed. This same method would apply to as many
CASE statements as are listed in the body of the CSWITCH. Note that if any of the
Software
®
SIMPL+
87

Advertisement

Table of Contents
loading

Table of Contents