TRS-80
MODEL
Statement/Functions
FOR var
=
exp
TO
exp
STEP
exp
Open
a
FOR NEXT loop.
STEP
is optional; if not used,
increment of one is used.
NEXT variable
Close FOR-NEXT loop.
Variable may be omitted.
To close nested loops,
a
variable list may be used.
See Chapter 18.
ERROR (code)
Simulate the error specified
by code (See Error Code
Table).
ON
ERROR
GOTO
line-number
If an error occurs in
subsequent
program lines,
branch to error routine
beginning
at
line-number
.
RESUME
n
Return from error routine
to line specified by n. If n
is zero or not specified, return
to statement containing error.
If n is "NEXT", return to
statement following error-
statement.
RANDOM
Reseeds random number
generator.
REM
REMark
indicator;
ignore
rest
of line.
Examples
FOR 1
=
1 TO
50
STEP 1.5
FORM%
=
J%TOK%-1
NEXT
NEXT I
NEXTI.J.K
Page
155
155
ERROR(14)
ON
ERROR GOTO
999
158
158
RESUME
RESUMEO
RESUME 100
RESUME NEXT
149
RANDOM
REM A IS ALTITUDE
182
160
214