
FORMAT
FOR
THE SCRATCH COMMAND:
PRINT#
15,
"SCRA
TCHO:
pattern"
or abbreviate
it
as:
PRINT#
15, ''SO:pattern''
''pattern''
can be any
file
name or combination
of
characters and wild card characters. As
usual ,
it
is
assumed that the command channel has -already been opened as
file
15
.
Although not absolutely necessary, it
is
best to include the drive number in Scratch
commands.
If you check the error channel after a Scratch command, as tlescribed
in
the prior
section, the value for ET (error track) will tell you how many files were scratched. For
exampl~,
if
your diskette contains program files named
"TEST",
"TRAIN",
"TRUCK",
and
"TAIL";
you may scratch all four, along with any other files beginning
with the letter
''T'',
by
using the command:
PRINT#l5,
"SO:T*"
Then,
to
prove they are gone, you can type:
GOSUB 59990
to call the error checking subroutine given earlier
in
this chapter, and
ii
the four listed
were the only files beginning with
"T",
you will see:
01,FILES
SCRATCHED,04,00
READY.•
The
"04"
tells you 4 files were scratched.
ERASING OLD PROGRAMS: BASIC 3.5
The Scratch command allows you
to
erase unwanted programs and files from your
diskettes, and free
up
the space they occupied for use
by
other files and programs.
It
can
be used to erase either a single file, or several files at once via pattern-matching (described
at the end
of
Chapter 3).
FORMAT
FOR
THE SCRATCH COMMAND:
SCRATCH
"pattern"
,Ddrive # ,Uunit #
32
"pattern" can be any
file
name or combination
of
characters and wild card characters. _
As
usual,
"D"
stands for drive number, which may only be 0 on the
1541
.
If
the dnve
number
is
omitted, 0
is
assumed. Likewise,
"U"
stands for unit (device) number,
normally 8.
If
"U"
is
omitted, 8
is
assumed.
Thanks
to
the defaults, the usual form
of
the Scratch command becomes:
SCRATCH
"pattern"
As a precaution, you will be asked:
ARE
YOU SURE? •
before Basic obeys a Scratch command.
If
you
are
sure, simply press Y and RETURN.
If
not, press RETURN alone or type
anr
other answer, and the command will be cancelled.
The number
of
files that were scratched will be automatically displayed. For exam-
ple,
if
your diskette contains program files named
"TEST'',
"TRAIN",
"
TRUCK"
, and
"TAIL",
you may scratch
all
four, along with any other
files
beginning with
the
letter
"T",
by
using the command:
SCRATCH
"T*"
and if the four listed were the only files beginning with "
T"
,
you
will see:
01,FILES SCRATCHED,04,00
READY. •
The
"04"
tells you 4 files were scratched.
SCRATCH·(FOR ADVANCED USERS)
Scratch
is
a powerful command, and should be used with caution,
to
be sure you only
delete the files you really want erased . When using it with a pattern,
we
suggest you first
use
the same pattern
in
a Directory command,
to
be sure exactly which files will be
deleted. That way you'll have
no
unpleasant surprises when you u·se the same pattern
in
the
Scratch command.
Recovering from a
Scratch
If
you accidentally Scratch a file you shouldn't have, there
is
still a chance
of
saving
it. Like Basic's New command,
Scratch doesn't really wipe out a
file
itself;
it
merely
clears the pointers to
it
in
the diskette directory.
If
you immediately set the diskette aside
and
protect
it
with a write-protect notch,
to
be sure
no
one adds any
files
to
the diskette, a
skilled user in a nearby Commodore user group may be able to recover your
file
for you. It
Will
help
if
you can remember what kind
of
file
it
wa
s you scratched (program, sequential,
etc.), since that information cannot be directly recovered from what
is
left
of
the
file
.
33
Kommentare zu diesen Handbüchern