CourseLab CourseLab 3.5. User's Guide Previous topic Next topic

SWITCH

Conditional action SWITCH (combined with CASE and ELSE actions) is intended to manage several action sequences by one condition (SWITCH/CASE/ELSE).

Parameters

The only parameter is expression, which will be compared with the values in CASE actions. Expression can contain CourseLab variable (#var_name, where var_name - variable name) or Object's property ($OBJ_ID.property, where OBJ_ID - Object ID and property - existing Object's property) or expressions.

Syntax

CASE and ELSE actions must be indented by 1 position from its parent SWITCH action. Action sequences, which are managed by CASE and ELSE actions, also must be indented by 1 position from its parent CASE or ELSE action.

Conditions are processed from top to bottom, therefore ELSE action must be the last in the condition list - after all CASE actions.

The example of SWITCH action: