Show / Hide Table of Contents

If Then Statements


General Control Statement

If and Then are statements used together to execute a particular action only if a specified Boolean expression is true.

Syntax

If <Boolean expression> Then <statement 1> {Else <statement 2>}

Syntax Examples

If Var1 = 5 Then 
{
    Wait 2 min
}
If (Attr2 = 5) Or (Var5 <> 0) Then 
{
    Wait 2 min
}
Else 
{   
    Wait 3 min
}
If Var1 > Attr2 Then
{
    Var1 = Attr2
    Wait Attr1
}
Else
{
    Inc Var1
    Wait Attr2
}

Parameters

<Boolean expression>

The true or false condition to evaluate.

<statement>

The action that is executed if the Boolean expression is found to be true.

Parameters Examples

The following example displays a message at the Truck Location when the value for Var1 is less than 10. If the value for Var1 is 10 or greater, nothing occurs at the Truck Location.

If Var1 < 10 Then
{
    Display "Var1 is in range"
}

If ...Then Example 1


If ...Then Example 2


If ...Then Example 3

In This Article
Back to top Generated by DocFX