List (gb.data)

This class implements a circular doubly-linked list, i.e. you have Variants linked together and can traverse them in either direction (thus doubly-linked). The next ancestor of the last element in the list will be the first and vice versa (thus circular).

Linked lists trash the CPU data cache when they are traversed. On the other hand, they can cope with less total memory movements than Arrays do. You have to decide when each class is called for. If unsure, choose an Array. It is always faster anyway :-)

This class is creatable.

This class acts like a read / write array.

This class is enumerable with the FOR EACH keyword.

Properties
AutoNormalize   Return or set whether the Index property is automatically converted to a normalised index.
Backwards   property Read Backwards As comp/gb.data.List.Backwards
Count   property Read Count As Integer
Current   Return a virtual object representing the current element.
Index   A shortcut to Current.Index.
Value   A shortcut to Current.Value.

Methods
Append   Sub Append ( Value As Variant )
Clear   Sub Clear ( )
FindFirst   Function FindFirst ( Value As Variant ) As Integer
FindLast   Function FindLast ( Value As Variant ) As Integer
FindNext   Function FindNext ( Value As Variant ) As Integer
FindPrev   Function FindPrev ( Value As Variant ) As Integer
FindPrevious   Function FindPrevious ( Value As Variant ) As Integer
MoveFirst   Sub MoveFirst ( )
MoveLast   Sub MoveLast ( )
MoveNext   Sub MoveNext ( )
MovePrev   Sub MovePrev ( )
MovePrevious   Sub MovePrevious ( )
MoveTo   Sub MoveTo ( Index As Integer )
Prepend   Sub Prepend ( Value As Variant )
Take   Function Take ( [ Index As Integer ] ) As Variant