Start » Filter Reference » Data Flow » Conditional Processing » MergeConditionals
Module: | FoundationLite |
---|
Returns the first not-Nil input object.
Name | Type | Description | |
---|---|---|---|
inConditionalObject1 | <T>? | First conditional input object | |
inConditionalObject2 | <T>? | Second conditional input object | |
inConditionalObject3 | <T>? | Third conditional input object | |
inConditionalObject4 | <T>? | Fourth conditional input object | |
inConditionalObject5 | <T>? | Fifth conditional input object | |
inConditionalObject6 | <T>? | Sixth conditional input object | |
inConditionalObject7 | <T>? | Seventh conditional input object | |
inConditionalObject8 | <T>? | Eighth conditional input object | |
outConditionalObject | <T>? | The first of the input objects that exists or nothing |
Description
The MergeConditionals filter is a tool of the Conditional Execution mechanism. The operation collects a number of conditional objects and passes the first of the existing input values onto the outObject output. If all of the input values are Nil, the outObject is set to Nil.
The operation is similar to MergeBranches, yet it computes a conditional object, and thus does not require that at least one of the input values is not-Nil.
Hints
- Also consider the coalescing operator (??) in Formula Blocks.
- This filter creates a full copy of one of the input objects. Thus, if you need the highest possible speed, use this filter only with primitive types. An alternative is to use Variant Step macrofilters which are fast and elegant.
Examples
inConditionalObject1 = Nil inConditionalObject2 = Nil inConditionalObject3 = "Mike" inConditionalObject4 = "Alice" inConditionalObject5 = Nil inConditionalObject6 = "Joanne" inConditionalObject7 = Nil inConditionalObject8 = Nil |
outConditionalObject = "Mike" |
inConditionalObject1 = Nil inConditionalObject2 = Nil inConditionalObject3 = Nil inConditionalObject4 = Nil inConditionalObject5 = Nil inConditionalObject6 = Nil inConditionalObject7 = Nil inConditionalObject8 = Nil |
outConditionalObject = Nil |
Complexity Level
This filter is available on Advanced Complexity Level.
See Also
- MergeBranches – Chooses the first non-Nil object, or reports an error if there is no such object.
- MergeIntoArray – Creates an array from all the non-Nil input elements.