Previous | Next | Table of Contents | Index | Program List | Copyright

Chapter 12

Multidimensional Arrays and Variant Records


12.1 Data Structures: Multidimensional Arrays
12.2 Problem Solving: Using Multidimensional Arrays
12.3 Continuing Saga: Keeping Track of Multiple Spiders
12.4 Data Structures: Variant Records
12.5 System Structures: Geometric Figures
12.6 Tricks of the Trade: Common Programming Errors
Chapter Review

So far, the arrays we have seen have been one-dimensional ones, and the record structures have been fairly simple. In this chapter we look at more interesting and complex structured types.

A multidimensional array has, as the name suggests, more than one dimension. Instead of being a linear collection of elements, it may have the "shape" of a rectangle (two-dimensional) or even a rectangular solid or cube (three-dimensional). In fact, there is in theory no limit to the number of dimensions an array type can have, although it is rare to see an example with more than three. Multidimensional arrays give us the ability to structure information in useful tabular forms.

A variant record is one with several different possible structures, instead of just one structure as we saw in Chapter 8. The structure of the record is determined, at execution time, by the value of a special field called the discriminant field; CASE constructs are used both to declare the record type and to process variables of the type.


Previous | Next | Table of Contents | Index | Program List | Copyright

Copyright © 1996 by Addison-Wesley Publishing Company, Inc.