Multidimensional arrays

Arrays can have one or more dimensions, up to a maximum of eight.  A one-dimensional array such as payments is a simple list of values.  A two-dimensional array represents a table of numbers with rows and columns of information.  Some examples of multidimensional arrays are:

DIM one!(15)       ' a one-dimensional list

DIM two!(15,20)    ' a two-dimensional table

DIM three!(7,9,1)  ' an 8 by 10 game board with room in the third  

                   ' dimension for 2 items: piece type and color

Arrays of four to eight dimensions are possible, but they become more difficult to conceptualize and keep straight.  You can define:

DIM five%(5,5,10,20,3)  ' a five-dimensional array

…but it's probably better to redesign this array into several smaller ones with fewer dimensions, or use an array of User-Defined Types.

 

See Also

Array Data Types

Subscripts

String arrays

Array storage requirements

Internal representations of arrays

Arrays within User-Defined Types

Array operations

POWERARRAY Object