HP 3000 Manuals

Arrays [ HP Pascal/iX Programmer's Guide ] MPE/iX 5.0 Documentation


HP Pascal/iX Programmer's Guide

Arrays 

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:

	       Click here to view figure.
            

Column-major order:

	       Click here to view figure.
            

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:

If the array is:      See:                  In the section: 

Unpacked              Table 5-1          "Unpacked Variables"

Packed                Table 5-3          "Packed Arrays"  

Crunched              Table 5-5          "Crunched Arrays and
                                            Records"  



MPE/iX 5.0 Documentation