Commodore 2001-8 User Manual page 130

Table of Contents

Advertisement

DIM
END
FOR
110 Z = FNA(3)
200 DEF FNA(V)= FNB(V)
113 DIM A(3I,B(10)
114 DIM R3(5,5), D$(2,2,2)
115 DIM Q1(N),Z(2'1)
117 A(8)=4
999 END
300 FOR V = 1 TO 9.3 STEP .6
310 FOR V=1 TO 9.3
B·2
Execution of this statement following the
above would cause Z to be set to 3/B
+
C,
but the value of V would be unchanged.
A function definition may be recursive.
A DEF statement may be written in terms
of other tunctians,'however.
Allocates space for matrices. All matrix
examples are set to zero by the DIM
statement.
Matrices can have more than one
dimension. Up to 255 elements
Matrices can be dimensioned dynamically
during program execution. If a matrix is
not explicitly dimensioned with a DIM
statement, it is assumed to have as many
subscripts as implied in its first use and
whose subscripts may range from a to 10
(eleven elements).
It this statement was encountered before
a DIM statement for A was found in the
program,
it
would be as if a DIM A(10) had
been executed previous to the execution of
line 117. All subscripts start at zero (0),
which means that DIM x (100) really
allocates 101 matrix elements.
Terminates program execution without
printing a BREAK message. (See STOP)
CaNT after an END statement causes
execution to resume at the statement
after the END statement. END can be used
anywhere in the program, and is optional.
V is set equal to the value of the
expression following the equal sign, in this
case 1. This value is called the initial value.
Then the statements between FOR and
NEXT are executed. The final value is the
value of the expression following the TO.
The step is the value for the expression
following STEP. When the NEXT
statement is encountered, the step is
added to the variable.
If no STEP was specified, it is assumed to
be one. If the step is positive and the new
value of the variable is
<
=to the final
value (9.3 in this example), or the step value

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pet 2001-8

Table of Contents