The Switch assembler makes it possible to perform various comparisons between the same arguments, in a more practical way and can be used in references, attributes, or item descriptions.
EXAMPLE:
@(switch(#PARAMETERS#, 0, 'Left Door', 1, 'Right Door', 'No Doors'))
In the example above, the formula evaluates the value of the PARAMETERS attribute and if it is 0, the return will be Left Door, if it is 1, the return will be Right Door, and if the value is neither 0 nor 1, the return will be No Doors.
In traditional form, the formula looks like this:
@(#PARAMETERS== 0 ? ‘Left Door’ : #PARAMETERS# == 1 ? ‘Right Door’ : ‘No Doors’))
In the Promob Catalog, in the item description, within the Module registration:
In the 3D space:
Switch (A, B, C, D, E, F)
A = Value to be evaluated. It can be an attribute, a reference, or a text;
B = Value to compare with A;
C = Return if A and B are equal;
D = Another value to compare with A;
E = Return if A and D are equal;
F = Return if neither B nor D is equal to A
There may be more test arguments (B and D) and return (C and E), depending on the number of tests desired, what will remain is the first comparison (A), and in the last case, none of the tests is true (F).