HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)

G-: 8
BASIC/XL array. The data type and dimensionality information are
contained in the flag word that immediately follows the address of the
actual parameter. The structure of the resulting actual parameter table
in memory is:
+---------------------------------------+
| address of parameter 1 |
|---------------------------------------|
| flag word 1 |
|---------------------------------------|
| address of parameter 2 |
|---------------------------------------|
| flag word 2 |
|---------------------------------------|
| . |
| . |
| . |
|---------------------------------------|
| address of parameter n |
|---------------------------------------|
| flag word n |
+---------------------------------------+
Flag Words - Data Type and Dimensionality Information
In the MPE XL operating system environment, each of the 4 byte flag words
is divided into a left, high-order 2 bytes and a right, low-order 2
bytes. The left 2 bytes contains the data type of the associated actual
parameter. The values that HP Business BASIC/XL uses to designate the
corresponding HP Business BASIC/XL data types are the same as those
returned by HP Business BASIC/XL's TYP and BUFTYP functions:
1 DECIMAL
2 STRING
5 SHORT INTEGER
6 SHORT DECIMAL
11 INTEGER
12 SHORT REAL
13 REAL
The right (low-order) 2 bytes will contain zero if the actual parameter
is a scalar. A string is considered to be a scalar. If the actual
parameter is either a string or numeric array, the right 2 bytes will
contain the number of dimensions of the array.
HP Business BASIC/XL's Internal Data Structures
The address of the HP Business BASIC/XL variable entered into the actual
parameter table is that of either the data value itself or the HP
Business BASIC/XL data structure information that is stored together with
values of that type.
Scalar Numeric Values
For numeric expressions that are evaluated and stored in a temporary
variable, scalar numeric variables and individual elements of a numeric
array, the address is that of the actual value stored in memory. The
amount of memory used by each of these values is dependent on the data
type as illustrated in the following table:
DECIMAL 8 bytes
SHORT INTEGER 2 bytes
SHORT DECIMAL 4 bytes
INTEGER 4 bytes
SHORT REAL 4 bytes
REAL 8 bytes
The Pascal data types used to declare HP Business BASIC/XL's DECIMAL and
SHORT DECIMAL data types are explained in the section, "Pascal Data
Structures for ANYPARM Calls," later in this appendix.
Scalar Strings