Skip to content

Conditional If/Then/Else

One of the most important custom action. Conditional If/Then/Else actions mark the beginning and end of a conditional block of actions: an If block. If the condition specified in the "Begin If" action is true, actions inside the If block are executed; if the condition is false, actions inside the If block are not executed.

See this Conditional wikipedia topic.

The If block must always terminate by an "End Conditional If/Then" action. Optionally, the If block can contain an Else custom action.

Description

To start an If block, add a "Begin Conditional If/Then" action to the action list. After having set its properties, add all actions depending on the condition. To close the If block, add an "End Conditional If/Then" action. Your If block is now operational.

Optionally, you can insert an intermediate "Else Conditional If/Then".

The If block is the best mean to evaluate the value of variables. For example you can check the result of custom actions (that return a variable) as you can see below:

About the "Begin Conditional If/Then" action

This action starts an If block.

Property Name Data Type Description
Operator TOperator Determines how the variable Variable1 is compared to the value Variable2. There is a defined set of operators from which you can choose in the list box. See below for more information.
Variable1 VarName Left operand: variable name or value.
Variable2 (a.k.a. Value) String Right operand: enter the value to be used in the comparison, or another variable name.

Operators Available:

  • Equals: the value of the variable Variable1 must equal the value given in the field Value.

  • NotEqual: the value of the variable Variable1 must not equal the value given in the field Value.

  • GreaterThan: the value of the variable Variable1 must be greater than the value given in Value.

  • LessThan: the value of the variable Variable1 must be less than the value given in Value.

About the "End Conditional If/Then" action

This action closes an If block statement. No properties.

About the "Else Conditional If/Then" action

If the condition evaluated is false, the execution continues in the following branch: all custom actions following the Else block are executed until the "End If" action is met.

Must be inserted between "Begin Conditional If/Then" and "End Conditional If/Then" actions.

No properties.

Detection of missing "End If/then"

Paquet Builder is able to detect if you have forgotten to close a "Begin Conditional If/Then" by an "End Conditional If/Then" when you compile your project.

All available actions