|
Using a 3 Dimensional Array
| Version Compatibility: |
Visual Basic 5 Visual Basic 6
|
More information: Most multi-dimensional arrays that are used are two dimensional arrays eg. databases with records and fields, screen coordinates with X and Y and recordsets with rows and columns, but there are
greater multi-dimensional arrays. There is very little
documentation on these arrays. Three dimensional arrays are
basically multiple two dimensional arrays layered on top of each
other.Three dimensional arrays have many uses eg. mapping 3d
graphics, calendars (where days are the columns, the weeks are
the rows and the months are the layers), or paging methods
for reports and recordsets (as in the example I provided below).
The code shows how to:
- Dimension a 3 dimensional array
- Populate the array
- Access each layers data seperately
- Print the data
Directions: Paste the code below into a form with autoredraw set
to true and a combo boxThis code has been viewed 129451 times. Instructions: Copy the declarations and code below and paste directly into your VB project. Declarations:
No Text Boxes
|