Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

ArgumentTypeDescription
conditionNBooleanThe condition to be checked. If it evaluates to true the corresponding result is returned and the switch statements ends.
resultNStringResult to be returned if the condition is True.
defaultResultStringIf no previous condition has evaluated to True, this is the result to be returned.


Note

If only one clause is provided in the switch statement, it is treated as the default clause regardless of its condition.

Examples

Simple

This example shows how attribute in.city, can be used to set a region value. If none of the codes are matched, "Unknown" is the default value returned.

...