Back to FabImage Library website
You are here: Start » Function Reference » All Functions » Array Basics » FisFilter_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: | fis |
Module: | FoundationLite |
Extracts a single element from an array at the specified index.
Syntax
void fis::FisFilter_GetArrayElement ( const ftl::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 FisFilter_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
- FisFilter_SetArrayElement – Sets an element of an array to a new value.