...
Argument | Type | Description |
---|---|---|
set | Array or Recordset | The Array array or Recordset recordset to get the result from. |
index | Integer | The position of the item in set to be returned. |
default value | any type | Specify a default value to return instead of the item itself. PhixFlow also returns this value:
If not specified |
...
the array to be returned. If index is not a valid entry, the function |
...
returns:
|
...
An invalid index is outside the array |
...
If you provided a default value
This default value is also used in the case where you ask for element 1 of an object that isn't a list. If you provide a default value then that is returned otherwise it just returns the object itself
If you dont; provide a list in get element, it doesnt fall over if you only ask for index 1
...
or recordset. Index positions start at 1, so 0 is an invalid index. | ||
default_value | any type | Optionally, a default value to return instead of _NULL if the index is not valid. |
If there is only one item in the set, getElement treats it as the first item in an array.
Examples
getElement(["Red", "Green", "Blue"], 2)
Returns the 2nd element, "Green".
getElement(["Red"], 1)
Returns the element, "Red".
["Red", "Green", "Blue"].3
...
Returns _NULL, as there is no element at position 8.
["Red", "Green", "Blue"].8
OR you will get the default value provided
...
Returns either _NULL or the default-value, because there is no eleme
getElement ([1,2,3],4)
getElement ([1,2,3],0)
...
[].1
Returns _NULL.
in.CustomerNames
...