Skip to main content
Version: Next (dev)

Arrays

Thirteen nodes for working with lists of values. Every node except MakeArray takes the array to operate on through a required Array input pin.

Elements are Variants — values whose type is not fixed — so reading one out often needs Variant_ConvertTo before you can use it.

Building an array​

MakeArray​

Executionin, out
Data inElements — one pin per entry you add
Data outArray
PropertyElements

Add entries to the Elements property and the node grows an input pin for each.

Reading​

NodeTitleData inData out
GetCount—Array"" — Int
IsEmpty—Array"" — Bool
Array_GetElementGetElement[{Index}]Array, Index — IntElement — Variant
Array_ContainsContains {Element}Array, Element"" — Bool
Array_IndexOfIndexOf {Element}Array, Element, StartIndex — Int"" — Int

None of these have execution pins — they are data nodes, evaluated on demand.

Array_IndexOf returns the position of the first match at or after StartIndex.

Modifying​

All of these have execution pins, because they change something.

NodeTitleData in
PushBack—Array, Element
PushBackRange—Array, Range — Array
Insert—Array, Element, Index — Int
Array_SetElementSetElement[{Index}]Array, Index — Int, Element
Array_RemoveRemove {Element}Array, Element
Array_RemoveAtRemoveAt {Index}Array, Index — Int
Clear—Array

PushBack appends one element; PushBackRange appends every element of another array.

Remove searches for a matching value; RemoveAt takes a position.

Walking an array​

Use ForEachLoop, which gives you Element and Index outputs and a LoopBody execution pin. It is almost always clearer than a ForLoop with GetElement inside.

ForEachLoop [LoopBody] -> (do something with each element)
ForEachLoop [Element] -> Variant_ConvertTo [Variant]
ForEachLoop [Completed] -> (carry on afterwards)
Why these are in two different places

Six array nodes live inside an Array folder — GetCount, IsEmpty, Clear, Insert, PushBack and PushBackRange.

The rest are top-level nodes that merely start with Array_: Array_GetElement, Array_SetElement, Array_Contains, Array_IndexOf, Array_Remove and Array_RemoveAt. MakeArray is top-level too.

They all behave the same way; only where you find them differs. This is a quirk of the engine source, so search by name rather than browsing the folder.

See Also​