7.4.3.1 Native arrays

Gambas has a predefined array class for each native data type. The name of these classes is the name of the data type followed by an open and a closed square bracket:

Boolean[] 	Array of Boolean Values
Byte[] 	        Array of byte values
Short[] 	Array of short values
Integer[] 	Array of integer values
Long[] 	        Array of long values
Single[] 	Array of Single values
Float[] 	Array of Float values
Date[] 	        Array of Date values
String[] 	Array of string values
Object[] 	Array of Object values
Pointer[] 	Array of pointer values
Variant[] 	Array of Variant values

You can initialize an array or create an array within an expression with the[….Chapter 7.4.5 Inline Arrays.

Examples for the declaration of native arrays:

Dim myArray As New String[]
Dim myTable As New Float[10, 8]
Dim dArray As New Date[]
Dim aObjectArray As New Object[]

Example of using a native array:

Dim sElement As String
Dim aPlanets As String[]

aPlanetes = New String[]
aPlanetes = ["Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune", "Pluto"]

For Each sElement In aPlanetes
  Print sElement,
Next