BASIC
700
PRINT "NAME'S
"AGE"
710 READ N*
720 IF
N*
=
"END"
THEN PRINT
"END
OF LIST":
END
730
READ AGE
740 IF AGE
< 18 PRINT N*,
AGE
750 GOTO
710
760
DATA "SMITH?
JOHN",
30? "
ANDERSON
, T.
M.
"
»
20
770
DATA "JONES,
BILL", 15,
"DOE,
SALLY", 21
780
DATA "COLLINS,
ANDY", 17,
END
The program locates and prints all the minors' names from the
data
supplied.
Note
the use of an END string
to
allow READing lists of unknown length.
See DATA, RESTORE
RESTORE
Causes the next READ statement executed to
start over
with the first item in the first
DATA
statement. This lets your program
re-use the same DATA
lines.
Example:
810 READ X
820 RESTORE
830 READ
Y
840 PRINT
X, Y
850
DATA 50, 60
860
END
Because of
the
RESTORE
statement, the
second READ statement starts over with the
first DATA item.
See READ, DATA
143