[Next] [Up] [Previous] [Contents]
Next: Vectors as inputs and Up: Vectors and vector operators Previous: Vector assignments

Assignments to arrays

An unsubscripted array reference on the left-hand-side of an assignment is converted to a vector (see above). This means that the result of the assignment depends on whether the vector is ``big-endian'' or ``little-endian''. For example, if:

        x : array 0..1 of boolean;
then
        x := [1,0];
is equivalent to
        [x[0],x[1]] := [1,0];
which is equivalent to
        x[0] := 1;
        x[1] := 0;

On the other hand, if:

        x : array 1..0 of boolean;
then
        x := [1,0];
is equivalent to
        [x[1],x[0]] := [1,0];
which is equivalent to
        x[1] := 1;
        x[0] := 0;



Ken McMillan
Sat Jun 6 21:41:59 PDT 1998