NextElement()

Syntax

Result = NextElement(List())
Description
Moves from the current element to the next element in the list, or onto the first element if you have previously called ResetList()

Parameters

List() The name of your list variable, created with the NewList function. You must include the brackets after the list name.

Return value

Returns the address of the data in the next list element if successful and zero if there if there is no next element.

Example

  NewList Scores.w()

  For i=1 To 10
    AddElement(Scores())
    Scores() = 100 - i
  Next

  ResetList(Scores())
  While NextElement(Scores())
    ; This is OK since the first call to NextElement() will move the current element to the first item in the list
    MessageRequester("Score", Str(Scores()), #PB_MessageRequester_OK)
  Wend

See Also

ResetList(), PreviousElement(), FirstElement(), LastElement(), SelectElement(), ListIndex()

Supported OS

All

<- MoveElement() - List Index - PopListPosition() ->