Selection

Switch/Case-type selection statement

Allows to use selections depending on aliases. Besides exact matches a default case is supported. In the simple case selection statements work on scalar aliases. We can compare the scalar alias with one or multiple case values. For example in the code below, the first case{-branch is entered.
begin_alias{} "Color" = "Green" end_alias ... begin_selection{"Color"} case{"Red", "Green"} ... case{"Blue"} ... case_else{} ... end_selection
Remark: The alias used by the selection needs to be defined before the selection statement! The 'case_else{}' is optional. Within the case blocks all USER_common_variables syntax is allowed. All statements of a valid case block, i.e. the case which matches the current value of the SelectionAlias, are globally visible. It is also possible to use selections on alias vectors:
begin_alias{} "ColorVector" = "Red,Green,Blue" end_alias ... begin_selection{"ColorVector"} case{"2,Green"} ... case{...} ... case_else{} ... end_selection
For alias vectors the case statement contains the index (starting from 1) and the value to be checked. Alternatively we can compare each case{-statement to a specific vector entry.
begin_alias{} "ColorVector" = "Red,Green,Blue" end_alias ... begin_selection{"ColorVector(2)"} case{"Red", "Green"} ... case{"Blue"} ... case_else{} ... end_selection
In general, selection statements can be nested up to a certain limit. An extension of the Selection to mathematical expressions is possible:
begin_alias{} "Number" = "-3.1415926" end_alias ... begin_selection{} case{[&Number&>0]} ... case{[&Number&<0]} ... case_else{} ... end_selection
This is the so called mathematical-selection, and represents a way to mimic if-then-else constructions in the input file. The begin_selection{}-clause must not contain any argument.