HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
4- 100
PACK
The PACK statement assigns the values of data from one or more variables
to one scalar string variable, in the order specified by the names of the
variables in the referenced PACKFMT statement.
Syntax
PACK USING
line_id
;
str_var
Parameters
line_id
Identifies the program line of the appropriate PACKFMT
statement that specifies the variables to be packed and
the format in which to pack them within
str_var
.
str_var
Scalar string variable into which variables are to be
packed.
When packing a string variable into
str_var
, if the length of the value
of the string variable in the PACKFMT is less than that string variable's
maximum length, the PACK statement blank-fills the unused portion and
packs the entire string variable.
When packing a substring into
str_var
, if the length of the value of the
substring in the PACKFMT is less than the length of the substring, the
PACK statement blank-fills the unused portion and packs the substring
length.
Examples
See the UNPACK Statement.
PACKFMT
The PACKFMT statement is a list of variables that are to be packed or
unpacked by the PACK and UNPACK statements. You can also specify the
number of characters to be skipped between data values.
Syntax
PACKFMT [REALV]
pack_item
[,
pack_item
]...
Parameters
REALV The default real data type in a native mode program is
an IEEE floating point real format. Therefore, you must
specify "REALV" in the PACKFMT statement if the MPE V
real data format is desired. The keyword, "REALV" will
be ignored on MPE V.
pack_item
One of the following:
* Scalar numeric variable.
* Scalar string variable.
* Substring.
* String or numeric array.
* Space specifier: SKIP
number
.
* String or numeric literal.
* Numeric literal type converted with one of the
following built in functions:
SINTEGER