The IF function compares the inputs against the Compare
condition, then returns the specified True
or False
value.
If the output from this component is directed to a CHOICE component's first input stream, it can be used to determine which of the CHOICE component's input streams are output.
Input | Data Type | Description |
---|---|---|
Input1 | All | Data |
Input2 | All | Sets the Data property. (optional) |
Input3 | All | Sets the True property. (optional) |
Input4 | All | Sets the False property. (optional) |
Output | Data Type | Description |
---|---|---|
Output1 | All |
If the result is true, the specified True value is returned. If the result is false, the specified False value is returned. |
Name | Property Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Data | All | Defines the data to be compared against the first input stream's data. | ||||||||||||||||||
Compare | choice |
Specifies the comparison logic to be used against the inputs. Input 1 is placed on the left side of the comparison symbol, and the Data or Input 2 is placed on the right side of the comparison symbol.
|
||||||||||||||||||
True | String | Specifies what is output if the comparison is true. | ||||||||||||||||||
False | String | Specifies what is output if the comparison is false. |
The comparison data, defined either in the Data
property or by Input 2, is cast to the same data type as Input 1, and then the comparison is made.
Below is an example of a comparison made between different types and the results:
Property Name | Property Value |
Data | 5 |
Compare | > |
If Input 1 is the Integer value 100, the comparison above will be true. If Input 1 is a String of value "100", the above comparison will result in false.
Property | Output | |||
Input 1 | 1024 | Data | 512 | 1 |
Compare | >= | |||
True | 1 | |||
false | 2 |