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

3- 12
100 INTEGER B !Declares scalar numeric variable B
110 INTEGER B(5) !Declares numeric array variable B
120 DIM B$[15] !Declares scalar string variable B$
130 DIM B$(3)[15] !Declares string array variable B$
140 B: STOP !This line has a label, line label B
150 PRINT B !B refers to scalar numeric variable
160 PRINT B(1) !B refers to numeric array variable
170 PRINT B$ !B$ refers to scalar string variable
180 PRINT B$(3) !B$ refers to string array variable
190 GOTO B !B refers to line label
999 END
Numeric Variable Declaration Statements. Each numeric variable
declaration statement explicitly declares one or more numeric scalar or
array variables. The type of the variables depends on the statement.
Table 3-11 lists the numeric variable types, the number of bits used to
store the value, the range of each type, the precision of each type, and
the declaration statement that declares variables of that type. HP
Business BASIC/XL accepts the character "D" as well as "E" to indicate
scientific notation.
Table 3-11. Numeric Variable Data Types
---------------------------------------------------------------------------------------------
||| |||
| Numeric Type | Size | Range | Precision | Declaration |
||(in bits) |||Statement |
||| |||
---------------------------------------------------------------------------------------------
||| |||
| Short integer | 16 | [-32768, 32767] | Exact | SHORT INTEGER |
||| |||
---------------------------------------------------------------------------------------------
||| |||
| Integer | 32 | [-2147483648, 2147483647] | Exact | INTEGER |
||| |||
---------------------------------------------------------------------------------------------
||| |||
| Short decimal | 32 | [-9.99999 E63, -9.99999 | Exact (6 | SHORT DECIMAL |
| | | E-63], 0, [9.99999 E-63, | digits) | |
| | | 9.99999 E63] | | |
||| |||
---------------------------------------------------------------------------------------------
||| |||
| Decimal | 64 | [-9.99999999999 E511, | Exact (12 | DECIMAL |
| | | -1.00000000000 E-511], 0, | digits | |
| | | 1.00000000000 E-511, | | |
| | | 9.99999999999 E511] | | |
||| |||
---------------------------------------------------------------------------------------------
||| |||
| Short real | 32 | [-3.40282 E38, -1.17549 | Not Exact (6 | SHORT REAL |
| | | E-45], 0, [1.17549 E-45, | digits) | |
| | | 3.40282 E38] | | |
||| |||
---------------------------------------------------------------------------------------------
||| |||
| Real | 64 | [-1.79769313486231 E308, | Not Exact (15 | REAL |
| | | -4.94065645841247 E-324], 0, | digits | |
| | | [4.94065645841247 E-324, | | |
| | | 1.79769313486231 E308] | | |
||| |||
---------------------------------------------------------------------------------------------
The syntax for each of these declaration statements is in chapter 4.