In any case, if you have a troublesome filename, you can use the CHR$O function
to
specify troublesome characters without typing them directly. This may allow you
to
build
them into a RENAME command.
If
this fails, you may also use the pattern-matching
characters discussed for a SCRATCH command. This gives you a
way
to
specify the
name without using the troublesome characters at all, but also means loss
of
your file.
For example, if you have managed
to
create a
file
named"
"MOVIES",
with an
extra quotation mark at the front of the
file
name, you can rename it to
"MOVIES"
using
the CHR$O equivalent
of
a quotation mark in the RENAME command:
Example:
RENAME(CHR$(34)
+
"MOVIES")
TO
"MOVIES"
The CHR$(34) forces a quotation mark into the command string without upsetting
BASIC. The procedure for a
file
name that includes a SHIFT-SPACE
is
similar, but uses
CHR$(l60).
In cases where even this doesn't work, for example, if your diskette contains a
comma file, (one
named",")
you can get rid
of
it this way:
Example:
SCRATCH"?"
This example deletes all files with one-character names.
Depending on the exact problem,
you
may have
to
be very creative
in
choosing
pattern-matching characters that will affect only the desired file, and may have
to
rename
other files first to keep them from being scratched.
In
some cases, it may be easier
to
copy desired files
to
a different diskette and leave
the troublesome files behind.
COLLECT
The COLLECT command recalculates the Block Availability Map (BAM)
of
the
current diskette, allocating only those sectors still being used
by
valid, properly closed
files and programs. All other sectors (blocks) are left unallocated and free for reuse, and
all improperly closed files are automatically scratched. However, this brief description
of
COLLECT doesn't indicate either the power or the danger
of
the command.
Its
power
is
in
restoring
to
good health many diskettes whose directories or Block Availability Maps
have become muddled. Any time the blocks used
by
the files on a diskette plus the blocks
shown
as
free don't add up
to
the 664 (in
1541
mode) or 1328 (in
1571
mode) available
on
a fresh diskette, COLLECT
is
needed (with one exception below). Similarly, any time a
diskette contains an improperly closed
file
(splat file), indicated
by
an asterisk (*) next
to
its
file
type
in
the directory, that diskette needs
to
be
collected.
In
fact, but for the one
exception below, it
is
a good idea
to
COLLECT diskettes whenever you are concerned
about their integrity. Just note the number of blocks free
in
the diskette's directory before
and after using COLLECT.
If
the totals differ, there was indeed a problem, and the
31