Back to Aurora Vision Library Lite website
You are here: Start » All Functions » Array Basics » AvsFilter_GetArrayElement
AvsFilter_GetArrayElement
This is Filter Equivalent. This function may be present in generated code, but should not be used in hand-written code.
Header: | STD.h |
---|---|
Namespace: | avs |
Extracts a single element from an array at the specified index.
Syntax
void avs::AvsFilter_GetArrayElement ( const atl::Array<Type>& inArray, int inIndex, bool inInverse, Type& outValue )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
inArray | const Array<Type>& | Input array | |||
inIndex | int | 0 - | Index within the array | ||
inInverse | bool | False | Determines if the indices are counted from beginning or from end of the input array | ||
outValue | Type& | Element from the array |
Hints
- Make sure that inIndex will always be in range. If this cannot be guaranteed, use AvsFilter_GetArrayElement_OrNil instead.
- To get the last element of a non-empty array use inIndex = 0 and inInverse = True.
Examples
inArray = {1,4,3,2,5} inIndex = 3 inInverse = False |
outValue = 2 |
inArray = {1,4,3,2,5} inIndex = 3 inInverse = True |
outValue = 4 |
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Index out of range in GetArrayElement. |
DomainError | Negative index in GetArrayElement. |
See Also
- AvsFilter_SetArrayElement – Sets an element of an array to a new value.