PureBasic - Array
Overview
Arrays are structures to store indexed elements. Unlike a list or a map, the elements are allocated in a contiguous manner in memory. Therefore, it's not possible to easily insert or remove an element. On other hand, it provides a very fast direct access to a random element.
To work with Arrays, they have to be declared first. This could be done with the keyword Dim and can be resized with ReDim.
Arrays can be sorted using SortArray() or SortStructuredArray(), and can also be randomized using RandomizeArray().
Note: These arrays are dynamic because they can change size. In PureBasic, they exist however arrays said static, not resizable and used only in the structures. These arrays are written with square brackets. For example: ArrayStatic[2]. See here. The functions of this Array library can not be used with this type of array.
Command Index
ArraySize
CopyArray
FreeArray
Sort & misc.
SortArray()
SortStructuredArray()
RandomizeArray()
Example
Array.pbSupported OS
AllReference Manual - Index