program pptest9; type bit = 0 .. 1; fourbits = packed record onebit: bit; twobits: packed array [bit] of bit; anotherbit: bit end; eightbits = (b1, b2, b3, b4, b5, b6, b7, b8); var a1: packed array [1 .. 10] of 0 .. 127; { 7 bits } r: fourbits; a2: packed array [1 .. 40] of fourbits; a3: packed record i: -1 .. 1; s: set of eightbits; r: real; ch: char; case b: boolean of false: (twobits: 0 .. 3); true: (word: integer) end; i: integer; b: boolean; begin { packed array element access } { insertion } a1[i] := 1; a1[2] := 1; a1[1] := 1; { no shift needed } a1[1] := 0; { bit cleared } { extraction } i := a1[i]; i := a1[i]; { packed array assignment } a2[i] := r; { packed record field assignment } r.onebit := 1; r.anotherbit := 0; r.twobits[0] := 0; { compile time resolution } { mixed structure access } i := a2[i].onebit; i := a2[i].anotherbit; i := a2[i].twobits[i]; { other considerations } i := a3.i; { signed number } b := b4 in a3.s; { byte boundary } { reordered fields } a3.r := 0.0; { double word boundary } a3.ch := 'A'; a3.b := false; { variant fields } a3.word := a3.twobits end { pptest9 }.