<< Click to Display Table of Contents >> PTSwitchCase & PTSwitchCondition |
The two Switch functions are useful when having a lot of different conditions and the use of IIF would just be too long.
PTSwitchCase
With PTSwitchCase you use one property and then you define the case and the return value. You repeat this for all your cases. At the end you define a default value for the case if nothing applies.
When selecting New the return value is 1.
PTSwitchCondition
PTSwitchCondition is more flexible. Although, the example below is using the same use case as PTSwitchCase above.
You define a condition and a return value if the condition applies. As soon as the first condition applies, this is the return value you will get. Like with PTSwitchCase above, if no condition applies, the default value at the end will be returned.
Here we have the same result as with PTSwitchCase.