Gambas Documentation
Application Repository
Code Snippets
Compilation & Installation
Components
gb
gb.args
gb.cairo
gb.chart
gb.clipper
gb.complex
gb.compress
gb.crypt
gb.data
.List.Backwards
.List.Item
AvlTree
Circular
Deque
Heap
List
_get
_new
_next
_put
Append
AutoNormalize
Backwards
Clear
Count
Current
FindFirst
FindLast
FindNext
FindPrev
FindPrevious
Index
MoveFirst
MoveLast
MoveNext
MovePrev
MovePrevious
MoveTo
Prepend
Take
Value
PrioQueue
Queue
Stack
Trie
TriePrefix
gb.db
gb.db.form
gb.db.mysql
gb.db.odbc
gb.db.postgresql
gb.db.sqlite2
gb.db.sqlite3
gb.dbus
gb.dbus.trayicon
gb.debug
gb.desktop
gb.desktop.gnome.keyring
gb.desktop.x11
gb.eval
gb.eval.highlight
gb.form
gb.form.dialog
gb.form.editor
gb.form.htmlview
gb.form.mdi
gb.form.print
gb.form.stock
gb.form.terminal
gb.gmp
gb.gsl
gb.gtk
gb.gtk.opengl
gb.gtk3
gb.gtk3.opengl
gb.gtk3.webview
gb.gui
gb.gui.opengl
gb.gui.qt
gb.gui.qt.ext
gb.gui.qt.opengl
gb.gui.qt.webkit
gb.gui.trayicon
gb.gui.webview
gb.hash
gb.highlight
gb.image
gb.image.effect
gb.image.imlib
gb.image.io
gb.inotify
gb.jit
gb.libxml
gb.logging
gb.map
gb.markdown
gb.media
gb.media.form
gb.memcached
gb.mime
gb.mysql
gb.ncurses
gb.net
gb.net.curl
gb.net.pop3
gb.net.smtp
gb.openal
gb.opengl
gb.opengl.glsl
gb.opengl.glu
gb.opengl.sge
gb.openssl
gb.option
gb.pcre
gb.pdf
gb.poppler
gb.qt4
gb.qt4.ext
gb.qt4.opengl
gb.qt4.webkit
gb.qt4.webview
gb.qt5
gb.qt5.ext
gb.qt5.opengl
gb.qt5.webkit
gb.qt5.webview
gb.qt6
gb.qt6.ext
gb.qt6.opengl
gb.qt6.webview
gb.report
gb.report2
gb.scanner
gb.sdl
gb.sdl.sound
gb.sdl2
gb.sdl2.audio
gb.settings
gb.signal
gb.term
gb.test
gb.util
gb.util.web
gb.v4l
gb.vb
gb.web
gb.web.feed
gb.web.form
gb.web.gui
gb.xml
gb.xml.html
gb.xml.rpc
gb.xml.xslt
Controls pictures
Deprecated components
Developer Documentation
Development Environment Documentation
Documents
Error Messages
Gambas Playground
How To's
Language Index
Language Overviews
Last Changes
Lexicon
README
Search the wiki
To Do
Topics
Tutorials
Wiki License
Wiki Manual

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