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

3- 13
Array Variables. An array is an ordered collection of variables of the
same type. If the array elements are string variables, they have the
same maximum length.
An array element is legal wherever a scalar variable is legal.
An array variable is declared with a DIM, COM, or numeric declaration
statement. The syntax for each of these is in chapter 4.
Implicit Declaration. If a program unit does not contain an OPTION
DECLARE statement, its local variables can be declared implicitly, that
is, the first time they are used, rather than with a COM, DIM, or numeric
declaration statement.
Table 3-12 shows the characteristics that HP Business BASIC/XL gives to
implicitly declared variables.
Table 3-12. Characteristics of Implicitly Declared Variables
---------------------------------------------------------------------------------------------
||||
| Syntax of | Kind and Type of Variable | Size of Variable |
| First Variable Reference |||
||||
---------------------------------------------------------------------------------------------
||||
|
identifier
| Scalar variable of default | Not applicable |
| | numeric type. | |
||||
---------------------------------------------------------------------------------------------
||||
|
identifier
(
i1,...,in
) | Array variable of default | Dimensions:
n
where 1<=
n
<=6 |
| | numeric type. | Lower bound: default Upper |
| | | bound: 10 |
||||
---------------------------------------------------------------------------------------------
-
||||
|
identifier
$ | Scalar string variable. | Maximum length: 18 |
| | | characters |
||||
---------------------------------------------------------------------------------------------
||||
|
identifier
$(
i1,...,in
) | String array variable. | Dimensions:
n
where 1 <=
n
|
| | | <= 6 Lower bound: default |
| | | Upper bound: 10 Maximum |
| | | length of each element: 18 |
| | | characters |
||||
---------------------------------------------------------------------------------------------
Variable Initialization
Before executing a program unit, HP Business BASIC/XL allocates space
for its local variables. When HP Business BASIC/XL exits the program
unit, it deallocates local variable space.
Table 3-13 shows how and when HP Business BASIC/XL initializes local and
common variables.