Identifying Problems In Your Programs; Help; Error Trapping-The Trap Command - Commodore 128 System Manual

Hide thumbs Also See for 128:
Table of Contents

Advertisement

will erase lines 10, 50, and any in between. The use of DELETE is
similar to that of LIST, in that you can specify a range of lines up
to a given line, or following it, or a single line only, as in these
examples:
DELETE— 120
erases all lines up to and including 120
DELETE 1 2 0 -
erases line 120 and any line after it
DELETE 120
erases line 120 only

Identifying Problems in Your Programs

When a program does not work the way you expected, an error
message usually occurs. Sometimes the messages are vague,
however, and you still do not understand the problem. The
Commodore 128 computer has several ways of helping you
locate the problem.

Help

The Commodore 128 provides a HELP command that specifies
the line in which a problem has occurred. To actuate the HELP
command, just press the special HELP key on the row of keys
located above the main keyboard.
Type the following statement. It contains an intentional error, so
type it just as is:
10 ?3;4:5;6
When you RUN this one-line program, the computer prints 3 and
4 as expected, but then responds " SYNTAX ERROR IN 10" .
Suppose you cannot see the error (a colon instead of a semi­
colon between 4 and 5). You press the HELP key. (You can also
type HELP and press RETURN.) The computer displays the line
again, but the 5;6 is high lighted to show the error is in that line.
Error Trapping—The TRAP Command
Usually, if an error occurs in a program, the program "crashes"
(stops running). At that point, you can press the HELP key to
track down the error. However, you can use the BASIC 7.0 TRAP
command to include an error-trapping capability within your
5-11

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

128d

Table of Contents