Contents | Prev | Next

18.32 Invalid use of unpack (3)

Official Description

6.6.5.4 For unpack, 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 unpack procedure attempts to transfer array elements from the packed array into elements of 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

   unpack(packed, unpacked, 2);

means that the unpack procedure should attempt to transfer all ten elements from the packed array into the unpacked array starting at element 2 (i.e. transfer elements 21-30 from the packed array into elements 2-11 of the unpacked array), but the unpacked array does not have an element 11.

Error Handling

This error is always reported.

Contents | Prev | Next