If structure example
If, Else If, Else, and End If script steps define a structure that controls whether or not script steps are performed. This control depends upon the result of a testable condition or Boolean calculation.
 •
 •
When the calculation result is zero, blank, or content that does not resolve into a number, then the condition evaluates to False and the subsequent script steps are not performed.
Else If steps provide additional Boolean tests. Else steps provide alternative steps to perform if all conditions evaluate to False.
Examples
In the following example, the first line gives the calculation to evaluate. If the calculation result is true, the second line is performed. If the result is false, the second line of the script is ignored and the Else script is performed.
If [Sales::State = "CA"]
Perform Script ["Compute CA Tax and Total"]
Else
Perform Script ["Compute Total"]
End If
The first line of the following example gives the calculation to evaluate. If the calculation result is true, the second line is performed. If the result of the first calculation is false, the second line of the script is ignored and the Else If calculation is evaluated. If the Else If calculation result is true, the script step that follows it is performed. If the result is false, the next Else If calculation is evaluated. If this final Else If calculation result is true, the script step that follows it is performed, otherwise, it is ignored and the Else script step is performed.
If [Sales::State = "CA"]
Perform Script ["Compute CA Tax and Total"]
Else If [Sales::State = "OR"]
Perform Script ["Compute OR Tax and Total"]
Else If [Sales::State = "WA"]
Perform Script ["Compute WA Tax and Total"]
Else
Perform Script ["Compute Total"]
End If