If..Then..Else
Syntax
Command
Description
Return
Value
If (<expression>) [Then] <action> [Endif]
Tests
expression
and performs
action
if true
The
result of
action
If (<expression>) [Then] <action1> Else <action2> [Endif]
Tests
expression
and performs
action1
if true or
action2
if false
The
result of
action1
or
action2
Abbreviation
None
Description
The
If .. Then .. Else
statements are used to conditionally execute commands based on the value of an
expression.
Consider this command:
If ('x' == 1) Then Cue 1 Go
The above example first checks the value of the variable
x
, and if it is equal to 1, then Cue 1 is executed.
On the other hand, if
x
is not equal to 1, then nothing will happen. Since no commands are present after the
“Cue 1 Go”, an
EndIf
is not necessary.
See the section on
for more information about the kinds of expressions that can follow an
If
statement.
Using Else
The
Else
keyword can be used to execute commands if the expression is false. Consider this example:
Interactive Technologies, Inc.
CueServer 2 User's Manual - 18.5.18
Page 274 of 429