HP Pascal/iX Programmer's Guide (31502-90023)

A-: 24
Example
TYPE
day = (sun,mon,tues,wed,thurs,fri,sat);
enum_32 = (e1,e2,e3,e4,e5,e6,e7,e8,
e9,e10,e11,e12,e13,e14,e15,e16,
e17,e18,e19,e20,e21,e22,e23,e24,
e25,e26,e27,e28,e29,e30,e31,e32);
VAR
a : PACKED ARRAY [1..11] OF day;
r : PACKED RECORD
f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11 : day;
END;
aa : PACKED ARRAY [1..4] OF enum_32;
rr : PACKED RECORD
f1,f2,f3,f4 : enum_32;
END;
Each element of the array a requires three bits, and no element can cross
a 2-byte boundary. The entire array occupies 35 bits, and is allocated
six bytes.
Each element of the record r requires three bits, and no element can
cross a 2-byte boundary. The entire record occupies 35 bits, and is
allocated six bytes.
Each element of the array aa requires six bits, but is allocated eight
bits (one byte) and is byte-aligned. The entire array takes four bytes:
Each field of the record rr requires and is allocated six bits, and no
field can cross a 2-byte boundary. The entire record occupies 26 bits,
and is allocated four bytes: