c = ListItems(list)
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.
Print(ListItems({1, 2, 3, 4, 5, 6, 7, 8, 9, 10}))This returns 10.