The function implements a programmable switch.
Result is an integer value.
Declaration
INT %Case(
INT in Ctrl,
INT in Default,
INT in Case1,
INT in Value1,
...
INT in CaseN,
INT in ValueN
)
Parameters
Ctrl
Switch control argument - determines which value
will be the function result.
Default
Default value. This value will be the function
result if none of the switch elements matches the control argument.
ValueX
Switch elements. If values of the parameters
Ctrl and CaseX are identical, the value of the parameter
ValueX will be the function result.
Description
The function gets the value of the parameter ValueX
if Ctrl is equal to CaseX. If Ctrl is equal to none of
the parameters CaseX, the function gets the value defined in the
parameter Default.