Summary

In this chapter, we’ve taken a stab at revisiting “Computer Science 201: Data Structures” or a similar university course you might once have taken. Of course, in this limited space, we can do little more than provide a “proof of concept”—the technique of using self-referential, abstract data structures in VBA works, and it works well. Because of the availability of class modules, you can use the techniques provided here to create hybrid data structures that you just couldn’t manage with VBA’s arrays and collections. Linked lists of binary trees, collections of linked lists, linked lists of linked lists—all these, and more, are possible, but we suggest drawing pictures on paper first!

Note that all the ideas presented in this chapter rely on data in memory. That is, there’s no concept of persistent storage when working with these data structures. If you want to store information contained in one of these abstract structures from one session to the next, you’ll need to design some storage mechanism, whether it be in the Registry, an INI file, or a table. In addition, if you run out of memory, you’ll receive a run-time error when you attempt to use the New keyword. Obviously, this shouldn’t happen. In production code, you’d want to add error handling to make sure your application didn’t die under low-memory conditions. For more information on handling errors, see Chapter 7.

This chapter presented a number of topics to keep in mind when working with data in memory, including:

© 1997 by SYBEX Inc. All rights reserved.