Defining an IF Function

An IF/Else function lets you define a condition in the If part of a function. When that condition is met, the action defined underneath it is performed; when the condition is not met, the action defined in the Else part of this function is performed.

When you load a project, all empty Else parts are hidden.

Use no more than four nested IF/For/For Each statements.

To define an If function:

1. Click Insert Instruction to display the following drop-down menu:

2. Select If to display the following action statement:

3. Click the link to define a condition using the Boolean Statement Editor, which is described in Boolean Statement Editor. A window similar to the following is displayed:

This condition determines when the action defined in Step 4 is performed.

When you hover over a condition link, the format of the condition is displayed in a tooltip.

This type of tooltip is displayed throughout the GUI wherever there are If or For statements with conditions.

4. Click the left bracket under the If statement, then click Insert Instruction to define an action. If you select Function Invocation, the following is displayed:

For more information, see Defining a Function Invocation.

5. Click the + next to the right bracket. The Else function area is displayed.

6. Click the left bracket under the Else statement, then click Insert Instruction to define an action. If you select Function Invocation, the following is displayed:

For more information, see Defining a Function Invocation.

You can only collapse an Else statement after deleting all the instructions within its brackets.

7. To add a command after the If statement, click the first right bracket and then click Insert Instruction.