Back to Aurora Vision Studio website

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

InsertToArray


Module: FoundationLite

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

Name Type Range Description
Input will be modified ioArray <T>Array
Input value inValue <T> Input value to be inserted
Input value inIndex Integer 0 - Input index within the inArray at which the inValue will be placed
Input value inInverse Bool Determines if the indices are counted from beginning or from end of the input 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 Advanced Complexity Level.

See Also

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