Dim

Syntax

Dim name.<type>(<expression>, [<expression>], ...)

Description

Dim is used to 'size' the new arrays. An array in PureBasic can be of any types, including structured, and user defined types. Once an array is 'sized' it can be resized but its content will be deleted. Arrays are dynamically allocated which means than a variable or an expression can be used to size them.

Example 1 :

Dim MyArray.l(41)
MyArray(0) = 1
MyArray(1) = 2 

Example 2 :

Dim MultiArray.b(NbColumns,NbLines)
MultiArray(10,20) = 10
MultiArray(20,30) = 20