12.1 Overview of Strings
A string is a sequence of ASCII characters. BASIC allows
you to use the following types of strings:
.
Dynamic strings
.
Fixed-length strings
.
String virtual arrays
Dynamic strings are strings whose length can change dur-
ing program execution. The length of a dynamic string
variable may or may not change, depending on the statement
used to modify it.
Fixed-length strings are strings whose length never
changes. In other words, their length remains static. String
constants are always fixed-length. String variables can be
either fixed-length or dynamic. A string variable is fixed-
length if it is named in a COMMON, MAP, or RECORD
statement. If a string variable is not part of a map or com-
mon block, RECORD, or virtual array, it is a dynamic string.
When a string variable is fixed-length, its length does not
change, regardless of the statement you use to modify it.
Table 12-1 provides more information about string modifica-
tion.
Strings in virtual arrays have both fixed-length and dynamic
attributes. String virtual arrays have a specified maximum
length from 0 to 512 characters. During program execution,
the length of an element in a string virtual array can change;
however, the length is always from 0 to the maximum string
size specified when the array was created. See Section 12.4
and Chapter 14 for more information about virtual arrays.