Switch('Selector', 'Case1', 'Value1', 'Case2', 'Value2',..., 'Default')
Arguments
|
'Selector' |
Expression, which is to be checked against different conditions |
|
|
'CaseN' |
Expression, which is to be compared to ‘Selector’ |
|
|
'ValueN' |
Result, if ‘Selector’ and ‘CaseN’ match |
|
|
'Default' |
Result, if none of the ‘CaseN’ matches ‘Selector’ |
|
Description
This command compares a ‘Selector’ expression to any number of ‘CaseN’, referring to the SQL statement CASE. At least 3 arguments are required. In case of an even number of arguments the last one will be considered automatically as ‘Default’, which will be taken if no ‘CaseN’ expression matches the ‘Selector’ expression.
If ‘Selector’ matches ‘CaseN’ the respective ‘ValueN’ will be returned as a result. If more than one ‘CaseN’ match ‘Selector’, the first ‘CaseN’ expression will be taken automatically.
The following signals are permitted to be used as ‘Selector’:
-
A numerical constant
-
A text constant
-
An equidistant or non-equidistant sampled channel
-
A text channel
Basically, the types of the expressions to be compared must match, otherwise the respective case will not be selected.