Contents | Prev | Next

7.4.37 The pack procedure

Description

The pack procedure assigns values to all the elements of a packed array by copying some or all of the elements of an unpacked array into the packed array. The elements of both arrays must have the same type.

Parameter

Example

Suppose you have the following arrays

   p : packed array[21..23] of integer;
   u : array[1..10] of integer;

then

   pack(u, 1, p)

copies elements 1 to 3 of u into elements 21 to 23 of p.

And

   pack(u, 5, p)

copies elements 5 to 7 of u into elements 21 to 23 of p

   pack(u, 9, p)

is an error because only two elements of u (i.e. 9 and 10) are available to be copied but p has three elements.

Portability

Operating Systems: All
Standard Pascal: Yes

Contents | Prev | Next