7.2 Creating Arrays Explicitly
You can create arrays explicitly with four BASIC statements:
DECLARE, DIMENSION, COMMON, and MAP.
In addition, you can declare arrays as components of a record
data type. See Chapter 9 for more information about records.
Normally, you use the DECLARE statement to create arrays.
However, you may want to create the array with another
BASIC statement as follows:
.
Use the DIM statement to create virtual arrays and
arrays that can be redimensioned at run time.
.
Use the COMMON statement to create arrays that can
be shared among program modules or to create arrays of
fixed-length strings.
.
Use the MAP statement to create an array and associate
it with a record buffer, or to overlay the storage for an
array, thus accessing the same storage in different ways.
When you create an array, the bounds you specify determine
the array's size. The maximum value allowed for a bound
can be as large as 2147483467; however, this number is ac-
tually limited by the amount of virtual storage available to
you. Very large arrays and arrays with many dimensions
can cause fatal errors at both compile time and run time.
The following restrictions apply to arrays:
- Greater than the current upper bound of the array
- Less than the current lower bound of the array
- Less than zero where no lower bound was specified