Back to Adaptive Vision Studio website

You are here: Start » Filter Reference » Conditional Processing » MergeDefault

MergeDefault


Creates a non-conditional value from a conditional one by replacing Nil with the specified default value.

Name Type Description
inConditionalObject <T>? Input conditional object
inDefaultObject <T> Object to be used if the conditional object is empty
outObject <T> Value of the conditional object, if it exists, or the default otherwise

The type of this filter is defined using the type variable T which represents any valid type. Read more.

Applications

This filter is usually used at the end of a program or subprogram to decide how to resolve special cases, represented by the Nil value.

Description

This filter is a tool of the Conditional Execution mechanism. It receives a conditional value and:

  • If it is Nil, replaces it with a specified default value.
  • Otherwise, copies it to the output.

Hints

  • Connect the conditional value to the inConditionalObject input.
  • On the inDefaultObject input define a value that will be substituted for Nil on the inConditionalObject input.
  • Also consider the coalescing operator (??) in Formula Blocks.

Examples

inConditionalObject = 5
inDefaultObject = 8
outObject = 5
inConditionalObject = Nil
inDefaultObject = 8
outObject = 8

Remarks

This filter is a counterpart of the IFERROR function from Microsoft Excel.

This filter can replace the following formula:

Complexity Level

This filter is available on Basic Complexity Level.

See Also