Contents | Prev | Next

18.29 Invalid use of pack (3)

Official Description

6.6.5.4 For pack, it is an error if the index-type of the unpacked array is exceeded.

Simplified Description

In other words, it is an error if the pack procedure attempts to transfer array elements from the unpacked array that do not exist. For example given:

var
   unpacked : array[1..10] of int;
   packed : packed array[21..30] of int;

then

   pack(unpacked, 2, packed);

means that the pack procedure should attempt to transfer ten elements from the unpacked array (since the packed array has ten elements), starting with the element two. So the pack procedure should transfer elements 2-11 from the unpacked array, but the unpacked array does not have an element 11.

Error Handling

This error is always reported.

Contents | Prev | Next