RemoveAt Procedure
Creates a new
List by removing one or more elements from an existing
List.
Overload #1: RemoveAt(list, index)
Declaration
function RemoveAt(
list as List of T, index as Number
) as List of T
Parameters
- list as List of T — The existing list from which to remove an element.
- index as Number — The zero-based index of the element to remove.
Return value
List of T — A new
List with the specified element removed.
Possible error codes
- ERR_LIST_INDEX_OUT_OF_RANGE
Example
Code
dim x = [1, 2, 3]
dim y = RemoveAt(x, 1)
print Len(y)
print y(0)
print y(1)
Output
Overload #2: RemoveAt(list, indices)
Declaration
function RemoveAt(
list as List of T, indices as List of Number
) as List of T
Parameters
- list as List of T — The existing list from which to remove elements.
- indices as List of Number — The zero-based indices of the elements to remove.
Return value
List of T — A new
List with the specified elements removed.
Possible error codes
- ERR_LIST_INDEX_OUT_OF_RANGE
Example
Code
dim x = [1, 2, 3]
dim y = RemoveAt(x, [0, 1])
print Len(y)
print y(0)
Output