GLBasic User Manual

Main sections

DIM

DIM array#$ [d1#] | [d2#] [d3#] [d4#]



Creates a memory array for numbers / strings / types. On creation, every single data index (for numbers or strings) will be set to 0. The first element has the index 0.

With DIM a[0] you free the allocated memory for array 'a'.

To keep the array the same size but clear the contents of every array position, use REDIM a[0].

*Note*, Arrays may not have more than 4 dimensions

Sample:
DIM array[8][8]
FOR x=0 TO 7
FOR y=0 to 7
array[x][y] = x*100 + y
NEXT
NEXT

PRINT array[4][5], 100, 100
SHOWSCREEN
MOUSEWAIT

See also...