CHAPTER 3
BASIC
7.0
COMMANDS
This chapter describes the disk commands used with the Commodore 128 computer
(in C128 mode). This is BASIC 7.0, which includes BASIC
2.0,
BASIC
3.5,
and
BASIC
4.0
commands, all
of
which can be used.
ERROR
CHECKING
When the drive light (green light) flashes, you must use the following command to
find out what the error is:
PRINT DS$
A message is displayed whether there is an error
or
not.
If
there was an error, this
command clears it from disk memory and turns off the error light on the disk drive.
Once the message is
on
the screen, you can look it up in Appendix B to see what it
means, and what to do about it.
For those
of
you who are writing programs, the following is a small error-checking
subroutine you can include in your programs:
59990 REM READ ERROR CHANNEL
60000 IF
DS>
1 THEN PRINT DS$:STOP
60010 RETURN
The subroutine reads the error channel and puts the results into the reserved variables
DS and DS$. They are updated automatically by BASIC.
Two
error numbers are harmless--{) means everything is OK, and 1 tells how many
files were erased by a SCRATCH command (described later in this chapter).
If
the error
status is anything else, line 60000 prints the error message and halts the program.
Because this is a subroutine, you access it with the BASIC GOSUB command, either
in immediate mode
or
from a program. The RETURN statement in line 60010 will
jump
back to immediate mode
or
the next statement in your program, whichever is appropriate.
SAVE
This command will save a program
or
file so you can reuse it. The diskette must be
formatted before you can save it to that diskette.
FORMAT FOR
THE
SAVE COMMAND
DSAVE "file
name"
[,Ddrive#] [,Udevice#]
This command will not work in copying programs that are not written in BASIC. To
copy these machine language programs, you can use the BSAVE command
or
the built-in
Monitor S command.
25