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.
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.
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