Conditional If/Then/Else¶
The Conditional If/Then/Else action is a fundamental feature for creating decision-making logic within your package. It allows you to create If blocks, which execute a set of actions conditionally based on specific criteria. If the condition in the Begin Conditional If/Then action is true, the actions within the block execute; otherwise, they are skipped.
For more details, see this Conditional Wikipedia topic.
Every If block must end with an "End Conditional If/Then" action. Optionally, an "Else Conditional If/Then" action can be included for alternate execution paths.
How to Use¶
- Start an If block by adding a "Begin Conditional If/Then" action.
- Add all actions to execute if the condition is true.
- Close the If block with an "End Conditional If/Then" action.
- Optionally, insert an intermediate "Else Conditional If/Then" action for alternate paths.
Example¶
This setup evaluates the value of a variable to decide the execution path:
Properties of "Begin Conditional If/Then"¶
This action starts an If block.
Property Name | Data Type | Description |
---|---|---|
Operator | TOperator | Determines how Variable1 is compared to Variable2 (see operators below). |
Variable1 | VarName | Left operand: the variable or value to be compared. |
Variable2 (Value) | String | Right operand: the value or variable to compare against Variable1. |
Operators Available¶
- Equals: Checks if Variable1 equals Variable2.
- NotEqual: Checks if Variable1 does not equal Variable2.
- GreaterThan: Checks if Variable1 is greater than Variable2.
- LessThan: Checks if Variable1 is less than Variable2.
Properties of "End Conditional If/Then"¶
This action closes an If block. It has no properties.
Properties of "Else Conditional If/Then"¶
- If the condition is false, actions within the Else branch execute.
- It must be placed between Begin Conditional If/Then and End Conditional If/Then actions.
- It has no properties.
Error Detection for Missing "End If/Then"¶
When you compile your project, Paquet Builder automatically checks for missing End Conditional If/Then actions to ensure your logic is complete.