Workspace 6.21.5
|
While an array input is useful when the user knows how many of something to supply to an operation, an ObjectArray is a useful way of passing an unknown number of data objects. The ObjectArrayBuilder operation sits somewhere between these two extremes, allowing the user to create an ObjectArray from a known number of items, or to build up an ObjectArray through successive updates (typically inside some kind of loop).
The ObjectArrayBuilder is a polymorphic operation. Users can change the data type being stored in the object array and they can rename the output of the operation if they wish. The typical usage of an ObjectArrayBuilder is to first set its data type to the data type you want to store, then make connections to the Items to add as necessary. Note that it is possible to store more than one data type in an ObjectArray, so when the data type is changed and items have already been accumulated into the object array, the array will end up with a mix of data types. For most uses, the accumulation should be reset if the data type is changed.
A more complicated example of building up an array inside a loop is shown in example 1.
There are a few key things to note about this example: