CHOICE
The CHOICE function chooses which input to direct as output.
Input1 specifies the index of the input stream to be output. The Base property sets Input2's base index value. Each input after Input2 is indexed from Input2's base index value.
For example, if Base is set to 1, Input2's base index value is set to 1, Input3's index value is 2, Input4's index value is 3, and so on. Then, if Input1 is 1, Input2 is directed to the output. If Input1 is 2, then Input3 is directed to the output.
Input
Number of Connections: Min: 1/Max:Infinite
Input | Data Type | Description |
Input1 | Integer | Choice selection data. |
InputN | All | Data. |
Output
Output | Data Type | Description |
Output1 | All | The chosen input stream is copied to the output stream. |
Property
Name | Property Type | Description |
Base | Integer | Specifies the base index value by which Input2 is referred. All inputs after Input2 are indexed from the Base value. For example, if the Base is 1, Input2's index value is 1, Input3's index value is 2, Input4's index value is 3, and so on. If the Base is 0, Input2's index value is 0, Input3's index value is 1, Input4's index value is 2, and so on. |
Topic
- If Input1 is a value outside the index range, null is output.
- If Input1 is not a number, CHOICE uses a default index selection value of 0. If the Base is 1, null is output. If the Base is 0, the value of Input1 is output.
Example
| Property | Output |
Input1 | 2 | Base | 1 | data2 |
Input2 | data1 | | | |
Input3 | data2 | | |
Input4 | data3 | | |
| Property | Output |
Input1 | 0 | Base | 0 | a |
Input2 | a | | | |
Input3 | b | | |
Input4 | c | | |
| Property | Output |
Input1 | 1 | Base | 0 | b |
Input2 | a | | | |
Input3 | b | | |
Input4 | c | | |
| Property | Output |
Input1 | 8 | Base | 7 | b |
Input2 | a | | | |
Input3 | b | | |
Input4 | c | | |