EasyManua.ls Logo

Commodore CBM - DIM

Commodore CBM
447 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Examples:
10
DATA
NAME."C.D."
50 DATA 1
E6.-1
O.XYZ
Defines
two
string variables.
Defines
two
numeric variables and
one string variable.
DIM
The Dimension statement (DIM) allocates space for
arrOlYs.
Format:
DIM
where:
{
var(j)
var(j). var(j)
....
var(j)
Dimension one array.
Dimension
multiple
arrays.
DIM statement usage
in program mode.
var
is
a numeric or string variable name.
is
a constant. variable or expression represent-
ing the subscript or subscripts of the array. in
the form:
var(j) Single-dimension array
vadi,j} Two-dimension array
vadi,j.k
....
} Multiple-dimension array
Refer to
"Arrays"
in
Chapter 3 for a complete description of array formats.
Arrays
with
more than eleven elements must
be
dimensioned in a DIM
statement. The DIM statement must
be
encountered once. and only once. in pro-
gram execution before any statement calls
an
element of the array. Arrays of
eleven elements or less (subscripts 0 through 10 for a one-dimensional array) may
be
used
without
being dimensioned by a DIM statement; for
su
ch arrays. eleven
array spaces are allocated
when
the first array element
is
encountered.
If the array
is
dimensioned more than once. or if
an
array having more than
eleven elements
is
not dimensioned. a ?REDIM'ED ARRAY error occurs and the
program
is
aborted. A
CLR
statement allows a Dimension statement
to
be
reex-
ecuted: this
is
not normally done. however.
DIM may
be
given in either immediate or program mode.
Examples:
10 DIM A(3)
45
DIM X$(44.2)
1000 DIM
MU(N.3*B). N(12)
126

Table of Contents

Other manuals for Commodore CBM

Related product manuals