Back to Adaptive Vision Studio website

You are here: Start » Filter Reference » Array Composition » InsertToArray

InsertToArray


Inserts a new element to an array at a specified location.

Name Type Range Description
ioArray <T>Array
inValue <T> Input value to be inserted
inIndex Integer 0 - Input index within the inArray at which the inValue will be placed
inInverse Bool Reversed order in the array

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

Examples

inArray = {1,2,3,4,5}
inIndex = 1
inValue = 10
outArray = {1,10,2,3,4,5}
inArray = {1,2,3,4,5}
inIndex = 5
inValue = 10
outArray = {1,2,3,4,5,10}

Errors

This filter can throw an exception to report error. Read how to deal with errors in Error Handling.

List of possible exceptions:

Error type Description
DomainError Index out of range in InsertToArray.

Complexity Level

This filter is available on Basic Complexity Level.

See Also

  • AppendToArray – Inserts a new element at the end of an array.