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

Wrox.com Code Downloads for this Chapter

The wrox.com code downloads for this chapter are found at www.wrox.com/remtitle.cgi?isbn=1118311813 on the Download Code tab. The code is in the 311813 C05.zipdownload and individually named according to the names given throughout the chapter.

Warning
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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.