advertisement

Find Code  Advanced Search   

Free Newsletters:   
browse free vb code
Submit Code
ASP,  HTML, and XML
Database
Dates  and Math
Files  and Directories
Forms  and Controls
Lists,  Collections, and Arrays
Miscellaneous
Multimedia/Games
Office/VBA
Network/Internet
Registry
Screen/Graphics
String  Manipulation
System/API
Windows  2000/XP
VB.NET/ASP.NET



advertisement
Using a 3 Dimensional Array

Author: Ethan (Featured Developer)
Category: Lists, Collections, and Arrays
Type: Snippets
Difficulty: Intermediate

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 box

This code has been viewed 129451 times.

Instructions: Copy the declarations and code below and paste directly into your VB project.


Declarations:

Code:

No Text Boxes

Sponsored Links