Aurora Visio Studio TOP » Filter Reference » Array » Array Basics » GetArrayElement_OrNil
Module: | FoundationLite |
---|
Extracts a single element from an array at the specified index; returns NIL if the index is out of range.
Name | Type | Range | Description | |
---|---|---|---|---|
inArray | <T>Array | Input array | ||
inIndex | Integer | 0 - | Index within the array | |
inInverse | Bool | Determines if the indices are counted from beginning or from end of the input array | ||
outConditionalValue | <T>? | Element from the array |
The type of this filter is defined using the type variable T which represents any valid type. Read more.
Hints
- If you can guarantee that inIndex will always be in range, use GetArrayElement instead.
- To get the last element of an array use inIndex = 0 and inInverse = True.
Examples
inArray = {1, 4, 3, 2, 5} inIndex = 3 |
outValue = 2 |
inArray = {1, 4, 3, 2, 5} inIndex = 5 |
outValue = Nil |
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 | Negative index in GetArrayElement_OrNil. |
Complexity Level
This filter is available on Basic Complexity Level.
Filter Group
This filter is member of GetArrayElement filter group.
See Also
- SetArrayElement – Sets an element of an array to a new value.