Arrays are stored in row-major order.
This means that an array is stored a row at a time, rather than
a column at a time (column-major order).
Example
VAR a : ARRAY [1..2,1..3] OF char; |
Row-major order:
Column-major order:
The HP Pascal packing algorithm uses this formula to allocate
an array:
number_of_elements * space_for_one_element |
The space_for_one_element depends
upon the array element type and whether the array is unpacked, packed,
or crunched. The same factors determine element alignment. See the
tables indicated below:
Table 5-3 Title not available (Arrays )