Chapter 5

Working with Data Structures

What You Will Learn in this Chapter

  • Using arrays
  • Working with enumerations
  • Using constants
  • Working with structures
  • Working with and using an ArrayList
  • Creating and adding items to a collection
  • Understanding and building lookup tables with Hashtables
  • Manipulating arrays using redimensioning and preserver Code Downloads for this Chapter

The code downloads for this chapter are found at on the Download Code tab. The code is in the 311813 C05.zipdownload and individually named according to the names given throughout the chapter.

Note that the Try It Outs in this chapter build on each other and the download version of the code provided is the final version and therefore may look slightly different from the versions you see in the previous chapter.

In the previous chapters, you worked with simple data types—namely, Integer and String variables. Although these data types are useful in their own right, more complex programs call for working with data structures—groups of data elements that are organized in a single unit. In this chapter, you learn about the various data structures available in Visual Basic 2012. You also will see some ways in which you can work with complex sets of data. Finally, you learn how you can build powerful collection classes for working with, maintaining, and manipulating lists of complex data.

Understanding Arrays

A fairly common requirement in writing ...

Get Beginning Visual Basic 2012 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.