Flow control commands – CUE Design Director Script Language User Manual

Page 15

Advertising
background image

Reference Manual Design Director Script Language

www.cuesystem.com

Page 15 of 94

2.4.3.

Flow control commands

Three commands from Visual Basic have been used – early macro exit, conditional macro branching
and cycle.

Macro exit – ExitMacro

Designed syntax:

ExitMacro

This command causes to exit the macro code. The control is given back to macro that the actual macro
was calling - in case of the use of macro for the event handling, the control is returned to system and
waits for the next event.

The command refers to Exit Sub and Exit Function commands from Visual Basic. EndSub Command
from Visual Basic is not required - as the particular macros are not required to be divided in text, only to
mark the end and the beginning each of them.

Conditional Branching

Designed syntax:

If <expression>

<commands>

ElseIf <expression>

<commands>

ElseIf <expression>

<commands>

..

Else <expression>

<commands>

EndIf

; where

<expression> - it is an expression that has to be uint type. When an error during the expression

evaluation occurs, an error is generated. If the control, after the error was handled, should
return to the next command then the expression is handled like it evaluated to zero.

<commands> - any syntactical correct block of commands

When generated the design environment checks the correctness of blocks If..EndIf. To every If
command there has to exit one EndIf command in the macro. Between If and EndIf commands there can
exist maximum one Else command and many or no ElseIf commands that need to be before the Else
command. At the same time If..EndIf block cannot interfere with the block structure of the command
cycle.

When run the first to be evaluated is If command. If the value is none zero then the commands after If
and the following will be executed. Then it is continued with the commands after EndIf. Otherwise the
first following ElseIf command is found and evaluates its expression. When the expression value is none
zero, its commands are executed and it is continued after EndIf, otherwise it keeps on searching.

Advertising