Take Procedure

Creates a new list from the first count elements in list. If count exceeds the number of elements in list, then the full original list is returned.
Declaration
function Take(
list as List of T, count as Number
) as T

Parameters

Return value

A list containing the initial elements.

Example

This example program constructs a list and then prints the first three elements.
Code
sub Main()
dim myList = [1, 2, 3, 4, 5, 6, 7]
dim newList = Take(myList, 3)
for each element in newList
print element
next
end sub
Output
1
2
3