Writing Real Programs in DCL, Second Edition

Chapter 22: Arrays

Overview

IN MOST PROGRAMMING LANGUAGES, AN ARRAY is a collection of data elements of the same type. In the C language, for example, you can create an array of integers, an array of floating-point numbers, or an array of characters. Two items of information are needed to refer to an individual element of an array. The first is the name of the array, and the second is an identifier for the particular element in question. This identifier is called an index or subscript. Most languages, C included, require that an index be an integer. A few languages, MUMPS being a notable example, allow an index to be any value whatsoever. The array is elevated from a simple ordered sequence of elements to an associative array that maps one value (the index or key) to another value (the data item).

DCL does not provide built-in array facilities. However, using apostrophe substitution, you can simulate an array with a collection of symbols. A portion of the symbol name serves as the array name and a portion serves as the index. There is no requirement that all the array elements be of the same type, because each symbol can contain any type of data.

22.1 Arrays with Integer Indexes

Most programming languages provide arrays whose index values are integers. This can be simulated in DCL with a collection of symbols, one for each array element, whose names consist of a fixed alphabetic part (the array name) and an integer part...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: CCD Image Sensors
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.