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.
Copyright © 1996 by Addison-Wesley Publishing Company, Inc.