EasyManua.ls Logo

Sinclair QL - Page 145

Sinclair QL
422 pages
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...
DIM
arrays
DIMN
Defines
an
array
to
SuperBASIC.
String, integer and floating point arrays can
be
defined.
String
arrays
handle
fixed
length strings and the
final
index
is
taken
to
be
the
stnng
length.
Array Indices
run
from 0 up
to
the maximum index specified
in
the DIM statement; thus
DIM
will
generate
an
array
with
one more element
in
each dimension than
is
actually
specified.
When
an
array
is
specified
it
IS
initialised
to
zero
for
a numeric array and zero length
strings
for
a stnng
array.
syntax:
index:
~
numenc_expresslon
array:
~
indentifier(index *
[,
Indexl *)
DIM array *[. array] *
example:
I.
DIM
string
array$(10,10,50)
ii.
DIM
matrix(100,100)
18
arrays DIMN
IS
a function which
will
return the maximum
size
of
a specified dimension
of
a
specified
array.
If
a dimension
is
not specified then the
first
dimension
is
assumed.
If
the
speCified
dimension does
not
exist
or the identifier
is
not
an
array then
zero
is
returned.
syntax:
array: = identifier
index:
~
numeric_expression
[1
for dimension
1,
etc.]
DIMN(array
[,
dimension] )
example: consider the array defined
by:
DIM
a
(2
,3
,4)
i.
PRINT
DIMN(A,1)
[will print
2]
ii.
PRINT
DIMN(A,2)
[Will
print
3]
iii.
PRINT
DIMN(A,3)
[will print
4]
IV
PRINTDIMN(A)
[will print
2]
v.
PRINT
DIMN(A,4)
[will print
0]
12184

Other manuals for Sinclair QL

Related product manuals