Example
:
10 DATA 10,60,70,80,90
20 READ A,B,C,D,E
30 PRINT A;B ;C;D;E
RUN
10 60 70 80 90
The READ statement consists of a list of variable names with commas between
each variable.
The DATA statement consists of a list of expressions separated by commas. These
expressions can be either numeric or strings. The READ statement makes the
computer look up the value of its variables from the DATA statement. When the
·
computer goes to READ first it will assign the first expression from the DATA
list. The next time it goes to READ it will assign the second value-And so on.
If the READ runs out of DATA you will get '?
out
OF DATA ERROR.'
RESTORE
If you want to use the same data later on in the program you can do so by using
the RESTORE statement.
Example:
10 DATA 1,3,8,9
20 READ A,B,D
30 RESTORE
40 READ X,Y
50 PRINT A;B
60 PRINT X;Y
70 END
RUN
1
3
1
3
48
Need help?
Do you have a question about the PreComputer 2000 and is the answer not in the manual?