ListSize

List command

Syntax

Returns the number of elements in a list.

ListSize(<list>())

Parts

<list>A list declared with NewList, written with its empty parentheses: scores().

Returns

The number of elements, 0 for an empty list, -1 after FreeList().

Good to know

  • This is a count, not a last index: positions go from 0 to ListSize() - 1. Arrays use the other rule (.length is the last index).

Example

NewList a.integer()FOR k = 1 TO 4  AddElement(a())NEXTConsole(Str(ListSize(a())))   ' 4
In the manual : Arrays, lists and maps