HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
4-: 15
If a type is not specified, implicit declaration
rules apply. After
type
, each
num_com_item
is of
that type until another
type
or a
non_num_com_item
appears.
num_com_item
Numeric variable declaration (for a scalar or array
variable).
If the COM statement is in a subunit,
num_com_item
must represent a numeric array with the abbreviation
identifier
([*[,*]...])
with one asterisk per dimension or without
asterisks. Not using asterisks specifies any number
of dimensions. Either format is legal, but the
format without asterisks is noncompilable. To
facilitate program documentation, numeric values can
be used in place of the asterisks, but these values
are ignored during program execution.
non_num_com_item
String variable declaration (for a scalar or array
variable) or file designator. If maximum length is
not specified for a string variable, it is 18.
Maximum length is not specified if the COM statement
is in a subunit.
If the COM statement is in a subunit,
non_num_com_item
must represent a string array with
the abbreviation
identifier
$([*[,*]...])
with one asterisk per dimension or without
asterisks. Not using asterisks specifies any number
of dimensions. Either format is legal, but the
format without asterisks is noncompilable. The
maximum length of each element is the same as
declared in the main program. To facilitate program
documentation, numeric values can be used in place
of the asterisks, but these values are ignored
during program execution.
The syntax of an HP Business BASIC/XL file number
is:
#
numeric_literal
numeric_literal
is a positive integer in the range
[1, 32767]. The file designated by the actual
parameter in the COM area is referenced by
#
numeric_literal
within the subunit declaring the
com area. If the main procedure or function in
which the HP Business BASIC/XL file number occurs is
to be compiled, the numeric_literal must be a
positive integer in the range [1, 16].
To make it easier to copy com area to subunits, the declaration of the
com area in the main program can be copied directly to the subunit. The
numeric values specifying the range of subscripts for a dimension for
either numeric or string array variables do not need to be changed to
asterisks. However, HP Business BASIC/XL interprets the values as place
holders for each dimension. The dimension information in the common area
in the program unit in which the common area is declared, usually the
main, is used to determine the array dimensionality and the subscript
bounds.
Example 1: Common Declarations
10 COM INTEGER A,B, REAL C,D, A$[7], P,Q, DECIMAL X,Y,Z, #2
Variable(s) Type