When you work with the List data type, there are a number of functions you can apply on that data type. These functions can be used to add items to and remove items from a list, determine the length of the list, find a certain item in the list, etc.
- ADD(X)
- CONTAINS(X)
- GET(index)
- SET(index, X)
- INSERT(index, X)
- Remove(X)
- RemoveAt(index)
- Count
- AddRange(X, [X], [X], …)
- GetRange(index, count, List of [X])
- RemoveRange(index, count)
- IndexOf(X)
- LastIndexOf(X)
- Reverse
ADD(X)
The ADD(X) function adds an item X to the end of the list.
CONTAINS(X)
The CONTAINS(X) function checks if an item X exists in the list. It returns a Boolean value, true if found, false if not found.
GET(index)
The GET(index) function gets an item from the list by a certain index and returns that item.
SET(index, X)
The SET(index, X) function updates an item in the list by a certain index. It sets the value X on the item at a certain index.
INSERT(index, X)
The INSERT(index, X) function inserts an item in the list, on a certain index. All the next items are moved one index further.
REMOVE(X)
The REMOVE(X) function removes the first occurrence of an item in the list based on the value of X. This function returns a Boolean value.
REMOVEAT(index)
The REMOVEAT(index) function removes the item on a certain index. This function returns a Boolean value.
COUNT
The COUNT(index) function returns the number of items in a list.
ADDRANGE(X [,X] [,X] [, …])
The ADDRANGE(X) function adds multiple items to the list at the same time.
GETRANGE(index, count)
The GETRANGE(index, count) function retrieves a number of items (count), starting on a certain index. The result is a List of [X].
REMOVERANGE(index, count)
The REMOVERANGE(index, count) function removes a multiple items (count), starting on a certain index. This function returns a Boolean value.
INDEXOF(X)
The INDEXOF(X) function returns the index of the first occurrence of an item based on the value of X.
LASTINDEXOF(X)
The LASTINDEXOF(X) function returns the last index of an item based on the value of X.
REVERSE
The REVERSE function reverses the order of the elements in the list.