Section 3.9
Programming In QuickBASIC
3.9 Arrays
An array is a number of memory locations all grouped under one name. Each memory
location can hold a different item of data and these items are numbered with an index
(normally known as a subscript).
All items of data in an array are of the same data type.
3.9.1 One Dimensional Arrays
The elements of a one dimensional array are indexed with a single number
and can be thought of as been side by side in a straight line.
In order to use an array we must first reserve some memory for it.
DIM <array name> (<min> TO <max>)
Example
DIM Num% (1 TO 5)
Num%(3) = 245
PRINT Num%(3)
When reading data from a DATA
statement, FOR NEXT
loops
are useful. If we want to be able to access any data at any time we can read the
data items into an array.