Crestron SIMPL+
Language Reference Guide - DOC. 5797G
®
{
}
case (2):
{
}
case (5+6):
{
}
case (x):
{
}
case ("abc"): // error – strings are not allowed
{
}
case (str):
{
}
}
}
Compiler Error 1602
construct error: Switch statement contains 'default' without
The Switch and CSwitch constructs must contain 'case' statements if the 'default'
statement is to be used. The 'default' statement is optional.
The following are examples of this error:
FUNCTION MyFunc( INTEGER x )
{
Switch ( x )
{
case (1):
{
}
default:
{
}
}
CSwitch ( x )
{
case (1):
{
}
default:
// error – 2 has been previously used
// error – expressions are not allowed
// error – variables are not allowed
// error – strings are not allowed
'case' labels
// ok
// ok
// ok
// ok
Software
®
SIMPL+
327