next up previous contents
Next: Vectors as inputs and Up: Vectors and vector operators Previous: Assignments to vectors   Contents

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;



2002-10-28