...
This section describes functions that are used to manage lists and their elements. Lists can be created to hold any type of data.
listAdd
Adds a new element to the end of an existing list.
...
Info | ||
---|---|---|
| ||
The following code leaves a list consisting of the two elements 7 and 5.
|
listClear
Removes all elements from a list.
...
Parameter | Description |
---|---|
| The list of elements to be removed |
Returns | Nothing |
listCreate
Creates a list of any type, and (optionally) populates it.
...
Parameter | Description |
---|---|
| The type of the elements comprising the list |
| The value of an element to be added to the list. Optional parameters: if none is entered, the list will be empty. |
Returns | The list |
listCreateSync
Creates a synchronized list of any type, and (optionally) populates it. This function may be useful for global lists in real time workflows, where the same list may be accessed from several threads at the same time.
...
Parameter | Description |
---|---|
| The type of the elements comprising the list |
| The value of an element to be added to the list. Optional parameters: if none is entered, the list will be empty. |
Returns | The list |
listFindIndex
Calculates the index of a requested list element.
The condition is tried for each element in the list until there is a match or the end of the list is reached.
...
Info | ||
---|---|---|
| ||
A list of integers containing the following elements [50, 2, 4, 152, 4] is searched for an element equal to 4:
The output is 2, since it is the index number of the first element equal to 4 in the list. |
listGet
Retrieves an element from a given position in the list.
...
Parameter | Description |
---|---|
| A list |
| Index of the element to retrieve |
Returns | The value given at the defined index |
listInsert
Inserts a value on a given position in a list. Note that this will NOT overwrite any existing values on the position, but only move the old element up a position.
...
Info | ||
---|---|---|
| ||
A list consists of the following elements: [2, 5, 72, 19] and the new value 127 is to be inserted on index position 2. This means the new indexes for the elements containing 72 and 19 are now 3 and 4 respectively:
|
listRemove
Removes an element from a list.
...
Parameter | Description |
---|---|
| A list |
| Index of the value to remove. The index must be in the range |
Returns | Nothing |
listSet
Replaces an existing element in a list.
...
Info | ||
---|---|---|
| ||
A list consists of the following elements: [2, 5, 72, 19] and the new value 127 should replace the value of the element on index position 2:
myList now looks like this: [2, 5, 127, 19] |
listSize
Gets the size of a list.
Code Block |
---|
int listSize ( list<type> list) |
...
Parameter | Description |
---|---|
| A list |
Returns | The number of elements in the list |
listSort
Sorts a list of any type. For UDR lists, sorting is based on a field in the UDR.
...