| PCK(
) is used to pack a numeric value into a string
expression. It is the counterpart of the UPK( )
function. The
packing algorithm used takes a numeric value and splits
it into a series of two digit values where each of the
two digit values represents a number between 0 and
99. The output length should
be half the number of digits in the number being packed
(rounded up) with the system default being 8 bytes.
These numbers are then
added to 32 to create the series of single-byte printable
characters that comprise the packed string. To unpack the
value each byte of the string has 32 subtracted from it
and the resultant values become a series of 2-digit
values in the final result.
Should the value of any
two-digit pair (when added to 32) equal or exceed the
standard file separator ($8A$), the value will be
incremented by one when the output string is created.
When unpacking the string, any byte exceeding the field
separator will be reduced by one prior to subtracting 32.
|