The unpack procedure

Description

The unpack procedure assigns values to some or all of the elements of an unpacked array by copying all of the elements of a packed array into the unpacked 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[51..60] of integer;

then

   unpack(p, u, 51)

copies elements 21 to 23 of p into elements 51 to 53 of u.

and

   unpack(p, u, 57)

copies elements 21 to 23 of p into elements 57 to 59 of u.

and

   unpack(p, u, 59)

produces an error since only two elements (i.e. 59 and 60) of u are available to be copied into but all three elements of p must be copied.

Portability

Operating Systems: All
Standard Pascal: Yes