Array types are instantiated similarly to any other type. Array declarations use brackets [] to specify each array dimension.
Integer[] iValues
The above creates an array variable named iValues, where each element is of type Integer. For more information see Array Declarations.
Individual array elements are accessed by typing the name of the variable followed by the array indexer for the element number you wish to access in square brackets. Array dimensions are 0-based i.e. iValues[3] denotes the 4th integer in iValues. For example…
Integer[] iValues
Integer iCount
For iCount from 0 to 9
Writeln iValues[iCount]
Loop
Arrays may be defined to be dynamic or static. Normally you will create dynamic arrays.
Arrays without a fixed size are called Dynamic arrays.
String[] sNames
The above creates a dynamic single-dimensional array variable named sNames, containing an undefined number of elements of type String. For more information see Array Declarations.
Dynamic arrays grow as needed when individual elements are accessed.
Dynamic arrays can be used for both local/global variable declarations as well as struct members and properties.
Arrays with a specified dimension size, are called Static Arrays. Static Arrays have a fixed number of elements, which cannot later be changed.
Integer[10] iValues
The above creates a static single-dimensional array variable named iValues, containing 10 elements of type Integer. For more information see Array Declarations.
The specified size in a static array variable declaration does not need to be a constant, it can also be an expression computed at run-time. Except for when used to declare a struct member or a global (non-local) variable, where the size must be a constant computed at compile-time.
A number of array functions for handling many typical array-specific tasks, such as searching for array elements, removing or adding new blank elements to dynamic arrays.
Static vs. Dynamic vs. Jagged Arrays