answer is assigned to B$, through the GETKEY statements in
lines 60 and 90. IF/THEN statements are used for loops in the
program to get the proper computer reaction to the different
keyboard inputs.
10 PRINT "WHO WROTE T H E RAVEN'?"
20 PRINT "A. EDGAR ELLEN POE"
30 PRINT " B. EDGAR ALLEN POE"
40 PRINT " C. IGOR ALLEN POE"
50 PRINT " D. ROB RAVEN"
60 GETKEY A$
70 IF A$=" B" THEN 150
80 PRINT "WRONG. TRY AGAIN? (Y OR N)"
90 GETKEY B$
100 IF B$="Y" THEN PRINT "A,B,C( OR D?":GOTO 60
110 IF B$=" N" THEN 140
120 PRINT "TYPE EITHER Y OR N - TRY AGAIN"
130 GOTO 90
140 PRINT "THE CORRECT ANSWER IS B."
145 GOTO 160
150 PRINT "CORRECT!"
160 END
GETKEY is very similar to GET, except GETKEY will wait for a
key to be pressed.
PROGRAMMING AIDS
ln earlier sections you learned how to make changes in your
programs, and correct typing mistakes with INST/DEL. BASIC
also provides other commands and functions which help you
locate actual program errors, and commands which you can use
to make programming sessions flow more smoothly.
Entering Programs
Auto
C128 BASIC provides an auto-numbering process. You
determine the increment for the line numbers. Say you want to
number your program in the usual manner, by tens. Before you
begin to program, while in DIRECT mode, type:
AUTO 10
RETURN
5-9