About this task
The If statement executes a block of statements based
on the results of a previous statement. The results are categorized
by a return code. The If statement checks the value of the return
code and executes the block if the statement is true.
You must
use the Eif statement (endif) with the If statement. If the conditions
of the If statement are not satisfied, use an Else statement to designate
the execution of alternate instructions.
Procedure
-
Click .
-
Under Transfer Settings, select .
- Select a step label on which to base the operator and value.
- Select the type of comparison statement in the Operator field.
- Select one of the following return codes in the Value field:
Return Code |
Description |
0 |
Indicates successful completion of the stop.
|
4 |
Indicates a warning.
|
8 |
Indicates an error condition.
|
16 |
Indicates a catastrophic error.
|
- To add optional comments, click the Comments control tab.
- Click OK to save the statement.
The If statement is displayed in the Process window.
- Create the block of statements that executes based on the
If statement. You can add an Else statement to execute a block of
statements if the condition in the If statement is not satisfied.
- Add an Eif statement to the end of the block to designate
the end of the block of statements.