ListIndex

List command

Syntax

Returns the position of the current element, counted from 0.

ListIndex(<list>())

Parts

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

Returns

A position from 0 to ListSize() - 1, or -1 when there is no current element or the list was freed.

Good to know

Example

NewList a.integer()Console(Str(ListIndex(a())))   ' -1FOR k = 1 TO 3  AddElement(a())NEXTSelectElement(a(), 1)Console(Str(ListIndex(a())))   ' 1
In the manual : Arrays, lists and maps