Function: getElement()
Returns the item at a specified index position within an Array or Recordset.
Syntax
- getElement(set, index)
- set[index]
- set.index
Argument | Type | Description |
---|---|---|
set | Array or Recordset | The Array or Recordset to get the result from |
index | Integer | The position of the item in set to be returned. |
If index is not a valid entry the function will return _NULL.
Examples
getElement(["Red", "Green", "Blue"], 2)
Returns the 2nd element, "Green".
["Red", "Green", "Blue"].3
Returns the 3rd element, "Blue".
["Red", "Green", "Blue"].8
Returns _NULL.
[].1
Returns _NULL.
in.CustomerNames
returns ... Please note that only recordsets can be indexed in this way, and lists must be accessed using numerical indices:
$numbersList.1
will return "x" if $numbersList has been set to in.CustomerNames.
in.$attributeName
will return the same as in.CustomerNames, if $attributeName is set to the string value $attributeName = "CustomerNames".