Tandy 1000 Basic Reference Manual page 144

Hide thumbs Also See for 1000:
Table of Contents

Advertisement

Chapter 10 I BASIC Keywords
DIM
Statement
DIM
array(dimenswn)[,array(dimnsion),
. .
.I
Sets aside storage for arrays with the dimensions you specify.
Array is the variable name of the array. It may be a string, inte-
ger, single precision, or double precision variable.
Dimension
is 1 or more integer numbers separated by commas that
define the dimensions of the array. The lowest element in a dimen-
sion is always zero, unless a n OPTION BASE 1 statement is
executed.
When you execute the DIM statement, BASIC reserves space in
memory for each element of the array. Each element is initially
set to zero for numeric arrays or null for string arrays.
If you do not dimension a n array, the maximum number of ele-
ments it can have is 11 (0-10).
Remember that arrays are completely independent of variables
that have the same name; that is MN and MNO are unique.
For more information on arrays, see Chapter 6.
Examples
DIM
A R ( 1 0 0 )
sets up a 1-dimensional array ARO, containing 101 elements:
AR(0), AR(l), AR(2),
...,
through AR(100).
D I M L l % ( 8 , 2 5 )
sets up a 2-dimensional array Ll%(), containing 9 x 26 integer
elements.
142

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents