Name
ListItems -- count items of a list (V2.0)
Synopsis
c = ListItems(list)
Function
This function iterates over all items in the list specified by list and returns how many items it has. Counting will stop when an element of type Nil is found in the list.

Note that this function only counts items at successive integer indices. It starts at index 0 and counts all items at successive integer indices until a Nil item is encountered. To count all items of a table, use the TableItems() function instead. See TableItems for details.

Note that this function is rather slow when used with normal Hollywood tables. To accelerate ListItems(), you have to use it with optimized lists created by CreateList(). See CreateList for details.

Inputs
list
table whose items are to be counted
Results
c
counter
Example
Print(ListItems({1, 2, 3, 4, 5, 6, 7, 8, 9, 10}))
This returns 10.

Show TOC