If_Then
Description
The first step in a conditional construct. The system evaluates the logical expression in the Recognition field of the If_Then step. If the expression evaluates to True, the system runs the steps between the If_Then step and the End_If step or the Else step, if it exists. If the expression evaluates to False, the system jumps to the Else step, if it exists, or to the End_If step if there is no Else step, and continues the run.
If_Then supports these logical operators:
<>, >=, <=, >, <, =
You can use the AND and OR logical operators to specify multiple conditions.
Example
This example shows the use of multiple conditions and nested conditionals:
| Type | Action | Recognition | Parameters | Value |
|---|---|---|---|---|
|
Variable |
Set_Value |
&Integer |
|
3 |
|
Conditional |
If_Then |
&Integer>=1 AND &Integer<=10 OR &Integer=0 |
|
|
|
Log |
Message |
Determine if integer is odd or even |
|
|
|
Log |
Message |
Enter first nested conditional |
|
|
|
Conditional |
If_Then |
&Integer=0 |
|
|
|
Log |
Message |
Do not divide by 0 |
|
|
|
Conditional |
Else |
|
|
|
|
Variable |
Set_Value |
&Half=Divide(&Integer|2|dec=1) |
|
|
|
Log |
Message |
Enter second nested conditional |
|
|
|
Variable |
Set_Value |
&Odd=Substr(&Half|3) |
|
|
|
Conditional |
If_Then |
&Odd=5 |
|
|
|
Log |
Message |
The number is odd |
|
|
|
Conditional |
Else |
|
|
|
|
Log |
Message |
The number is even |
|
|
|
Conditional |
End_If |
|
|
|