HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
3- 14
Table 3-13. Variable Initialization
---------------------------------------------------------------------------------------------
|| | |
||Local Variable | Common Variable |
|| | |
---------------------------------------------------------------------------------------------
|| | |
| Initialized to | Numeric: zero. | Numeric:zero. |
|| | |
| | String: null string. | String: null string. |
|| | |
---------------------------------------------------------------------------------------------
|| | |
| When | Before HP Business BASIC/XL | Before HP Business BASIC/XL |
| | executes the program unit that | executes the first program unit |
| | declares the variable (for the | that declares the variable. |
| | main program unit, this is only | |
| | when a RUN or GET command is | |
| | executed). | |
|| | |
---------------------------------------------------------------------------------------------
|| | |
| How Often | Each time HP Business BASIC/XL | Once. |
| | executes that program unit. | |
|| | |
---------------------------------------------------------------------------------------------
|| | |
| Unless | OPTION NOINIT applies to that | GLOBAL OPTION NOINIT was |
| | program unit. | specified. |
|| | |
---------------------------------------------------------------------------------------------
Variable Reference
HP Business BASIC/XL can reference an entire scalar or array variable, a
single array element, or a substring of a string variable. A substring
reference can be made to a scalar string variable or a string array
element.
Table 3-14 explains how to reference variables and variable parts, and
gives examples.
Table 3-14. Variable References
---------------------------------------------------------------------------------------------
|| ||
| Variable | Reference by | Examples |
|| ||
---------------------------------------------------------------------------------------------
|| ||
| Scalar |
var_name
|X |
|| ||
|| |A$|
|| ||
---------------------------------------------------------------------------------------------
|| ||
| Entire array |
var_name
or
var_name
(*[,*]...) | B(*), S$(*) |
|| ||
---------------------------------------------------------------------------------------------
|| ||
| Array element |
var_name
(
num_expr
[,
num_expr
]...) | B(1) |
|| ||
| | One
num_expr
per dimension. | S$(2,4,6) |
|| ||
| | For each dimension,
num_expr
is in the | |
| | range [
lower_bound
,
upper_bound
]| |
|| ||
---------------------------------------------------------------------------------------------
|| ||