Commodore 128 Programmer's Reference Manual page 71

Hide thumbs Also See for 128:
Table of Contents

Advertisement

BASIC BUILDING BLOCKS AND BASIC 7.0 ENCYCLOPEDIA
61
n
/ I
n
\
RENUMBER,, 65
Starting at line 65, renumbers in increments of 10. Line
65 becomes line 10. If you omit a parameter, you must
still enter a comma in its place.
RESTORE
Reset READ pointer so the DATA can be reREAD
RESTORE [line#]
If a line number follows the RESTORE statement, the READ pointer is set to the first
data item in the specified program line. Otherwise the pointer is reset to the beginning of
the first DATA statement in the BASIC program.
EXAMPLES:
10 FOR I = 1 TO 3
20 READ X
30 ALL = X + ALL
40 NEXT
50 RESTORE
60 GOTO 10
70 DATA 10,20,30
10 READ A,B,C
20 DATA 100,500,750
30 READ X,Y,Z
40 DATA 36,24,38
50 RESTORE 40
60 READ S,P,Q
This example READs the data in line 70 and stores it in
numeric variable X. It adds the total of all the numeric
data items. Once all the data has been READ, three
cycles through the loop, the READ pointer is RE-
STOREd to the beginning of the program and it returns
to line 10 and performs repetitively.
Line 50 of this example RESTORES the DATA pointer
to the beginning data item in line 40. When line 60 is
executed, it will READ the DATA 36,24,38 from line
40, and store it in numeric variables S, P, and Q,
respectively.
RESUME
Define where the program will continue (RESUME) after an error has been trapped
RESUME [line number | NEXT]
This statement is used to restart program execution after TRAPping an error. With no
parameters, RESUME attempts to re-execute the statement in which the error occurred.
RESUME NEXT resumes execution at the statement immediately following the one indi
cating the error. RESUME followed by a line number will GOTO the specific line and
resume execution from that line number. RESUME can only be used in program mode.
EXAMPLE:
10 TRAP 100
15 INPUT " ENTER A NUMBER" ;A
20 B = 100/A
40 PRINT* THE RESULT = ";B

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents