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.
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:
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.
In general, selection statements can be nested up to a certain limit.
An extension of the
Selection to mathematical expressions is possible:
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.