Displaying an Array (Command Program)

Arrays are displayed much like series are displayed. When a command is the name of an array, the Session Log displays all the elements of the array. For an m x n array, the elements are displayed in order from row 0 to row m - 1 and within each row, from column 0 to column n - 1. Consider the array called Numbers, which is defined as follows:

array Numbers =
   {1, 2, 3, 4;
    5, 6, 7, 8;
    9, 10, 11, 12};

You can list all the elements of the array by typing the name of the array as a command.

Numbers

The Log displays every element of the array Numbers, using subscripts starting from 0.

[0][0] = 1
[0][1] = 2
[0][2] = 3
[0][3] = 4
[1][0] = 5
 .
 .
 .
[2][2] = 11
[2][3] = 12

You can also display a single element, but you must include both subscripts (unless the array contains a single row, in which case the first subscript may be omitted).

Numbers[1][2]

The Log displays the single value represented by the array element.

= 7

Versions: DPL Professional, DPL Enterprise, DPL Portfolio

See Also

Displaying Series

Working in the Command Program