Free Term Papers on Data Structures: Vb And Vba Offer Two Options: Arrays And Collections

OPPapers.com Essay Index >> Technology >> Data Structures: Vb And Vba Offer Two Options: Arrays And Collections

We have many free term papers and essays on Data Structures: Vb And Vba Offer Two Options: Arrays And Collections. We also have a wide variety of research papers and book reports available to you for free. You can browse our collection of term papers or use our search engine.

Essays from FratFiles.com
  1. Data Structures: Vb And Vba Offer Two Options: Arrays And ...

    Data structures: VB and VBA offer two options: arrays and collections. This
    month is devoted to data structures. This isn'ta computer ...

  2. A Project Proposal For The Enhancement Of The Budget Report ...

    ... 215 Other Structures – are those not qualified in the ... end" (the forms, reports, queries
    and VB code) can ... developer to move a matured application's data to a ...

View More Papers...

Data Structures: Vb And Vba Offer Two Options: Arrays And Collections

Submitted by runyonave on October 31, 2007

Category: Technology
Words: 826 | Pages: 4
Views: 297
Popularity Rank: 31,739
Average Member Grade: N/A (Add a Comment / Grade this Paper)

This month is devoted to data structures. This isn't a computer science course, so let's define a data structure as a data holder--something that holds whatever data we need while our program executes. Visual BASIC and VBA use two basic data structures: the array and the collection. This month when I say VB, I also mean VBA.

ARRAYS

Most VB programmers are familiar with the array (figure 1). An array can be single or multidimensional, which means it can have rows and columns. While the array is the most commonly used data structure, it's not the best choice for at least two reasons. The first is data access. To find something within the array, you have to know exactly what you want. If you knew that, you wouldn't have to look, would you? To search for an item, you must iterate through the array.

[FIGURE 1 OMITTED]

The second reason is that the array must be dimensioned to a known limit. Once set, it's not easy to add an item after that limit is reached. For example, if you have a list of four people, you can't add a fifth person until you resize the array using ReDim or ReDim Preserve. ReDim resizes the array and clears any existing values, while ReDim Preserve resizes and keeps any existing values. Also, the upper limit of the array can't be a dynamic variable. An exception to the dimensioning rule is using an array with a command such as Split (figure 2).

[FIGURE 2 OMITTED]

If the array isn't dimensioned, the Split command dimensions and fills the array on the fly. Arrays are zero-based in VBA (and in VB, although you can use the Option Base statement to change it). In most cases, the array is limited to a single data type.

COLLECTIONS

A collection (figure 3) is usually a better choice for a data structure. All AutoCAD programmers have used collections whether they realize it or not, because AutoCAD uses them. Layers and blocks are two of the...

You must Login to view the entire paper.
If you are not a member yet, Sign Up for free!