case...end case


The case...end case statement allows a series of statements to run on a conditional basis, much like the if then...end if statement.


case exp in [value] statements {in [value] statements } {else statements} end case


exp – A field or expression that is to be compared to the value parameter on an equality basis.

in [value] – The value can be a single value or a range of values that the exp parameter can be equal to. The value must be enclosed in brackets. Use the word “to” to express a value range, such as “1 to 10”. The value for the expression “A or B” can be written as “A, B”.

statements – Any valid sanScript statement or group of statements.

else – If the else clause is included, then the statements following it will be run if all of the in [] clauses have been evaluated as false.


If multiple in [] clauses are included, the statements after the first in [] clause to be evaluated as true will be run, and subsequent clauses will not be evaluated.

If none of the in [] clauses are evaluated to be true and an else clause isn’t included, then no statements will be run until those listed after the end case statement.

Documentation Feedback