For example, you can find the value of a loop counter or other
variable. This is a powerful device when you are “debugging” or
fixing your program. Clear the computer’s memory and type the
program below.
10 X=INT(SQR(630))
20 Y=(.025*80)t2
30 X=INT(X*Y)
40 STOP
50 FOR J=0 TO Z STEP Y
60 ? “STOP AND CONTINUE”
70 NEXT
80 END
Now RUN the program. The computer responds with “ BREAK IN
40". At this point, the computer has calculated the values of X, Y
and Z. If you want to be able to figure out what the rest of the
program is supposed to do, tell the computer to PRINT X;Y;Z.
Often when you are debugging a large program (or a complex
small one), you’ll want to know the value of a variable at a certain
point in the program.
Once you have all the information you need, you can type CONT
(for CONTinue) and press RETURN assuming you have not
edited anything on the screen. The computer then CONTinues
with the program, starting with the statement after the STOP
command.
***** *** * **** ***** ***** **** * **** * **** * ***** **** * *
This section and the preceding one have been designed to
familiarize you with the BASIC programming language and its
capabilities. The remaining four sections of this chapter describe
commands that are unique to Commodore 128 mode. Some
Commodore 128 mode commands provide capabilities that are
not available in C64 mode. Other Commodore 128 mode
commands let you do the same things as a certain C64
command, but more easily. The syntax for all Commodore 7.0
commands is given in Chapter V, BASIC 7.0 Encyclopaedia.
4-24