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

3- 18
||| |
---------------------------------------------------------------------------------------------
||| |
| '7 | BEL | entry rings terminal's bell |
||| |
---------------------------------------------------------------------------------------------
||| |
| '13 | CR | carriage return |
||| |
---------------------------------------------------------------------------------------------
||| |
| '48 | 0 | zero |
||| |
---------------------------------------------------------------------------------------------
String Lengths
Associated with every string variables is a maximum length and a current
length. Table 3-18 explains the two types of length. The units are the
number of eight bit characters.
Table 3-18. Maximum vs Current String Length
---------------------------------------------------------------------------------------------
|| | |
||Maximum Length | Current Length |
|| | |
---------------------------------------------------------------------------------------------
|| | |
| Definition | Length of longest string value | Length of string value that is |
| | that can be assigned to string | currently assigned to string |
| | variable. | variable. |
|| | |
---------------------------------------------------------------------------------------------
|| | |
| Range | [1, 32767]. | [0,
curlength
] where
curlength
is |
| | | current length. |
|| | |
---------------------------------------------------------------------------------------------
|| | |
| Assigned | Once, when string variable is | Each time a value is assigned to |
| | declared. | string variable. |
|| | |
---------------------------------------------------------------------------------------------
|| | |
| Default | 18 (for implicitly declared string | Zero (length of the null string). |
| | variable). | |
|| | |
---------------------------------------------------------------------------------------------
When program execution begins in a main, procedure or function in which a
local string variable is declared either explicitly or implicitly and
OPTION INIT is active, the current length is initialized to zero. The
effect of initializing a string variable to zero is to set the value of
the string to the null string.
Strings declared in a common area are initialized to the null string if
the INIT option is active when the main procedure or function that
contains the first occurrence of that common area begins execution.
Examples
100 DIM A$ !Maximum length of A$ is 18 by default
110 DIM B$[5] !Maximum length of B$ is 5
120 A$="Cat" !Current length of A$ is 3
130 B$="Birds" !Current length of B$ is 5