
RENAMING AND SCRA TCIDNG TROUBLESOME FILES
(ADVANCED
USERS)
Eventually, you may run across a
file
which has a crazy filename, such as a comma
by
itself(
","
) or one that includes a
SHIFfed
SPACE. Or perhaps you will
find
one
th
at
includes nonprinting characters. Any
of
these can be troublesome. Comma files ,
fo
r
in
stance, are an exception to the rule that no two files can have the same name. Since
it
shouldn't be possible to make a
file
whose name
is
only a comma, the disk never expec
ts
you to do it again .
Files with a
SHIFT-SPACE
in
their name can also be troublesome, because the disk
interprets the shifted
SPACE as signalling the end
of
the file name, and prints whatever
follows after the quotation mark that marks the end
of
a name
in
the directory. Th
is
technique can also be useful , allowing you to have a long
file
name, but also make the
disk recognize a small part
of
it
as
being the same
as
the whole thing without using
pattern-matching characters.
In
any case, if you have a troublesome filename, you can use the Chr$() 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
in
a Scratch command. This gives you a way to specify the name without using
the troublesome characters at
all
, but
al
so means loss
of
your
file
.
For example, if you have managed
to
create a
file
named "
"MOYIES",
with an
extra quotation mark at
til
e front
of
the
file
name, you can rename
it
to " MOYIES" by
using the Chr$() equivalent
of
a quotation mark
in
the Rename command:
BASIC 2 FORMAT:
PRINT#l5
,"
RO
:MOYIES = "
+CHR$(34)+
"MOYIES"
BASIC
3.5 FORMAT:
RENAME (CHR$(34) + " MOYIES " ) TO " MOYIES "
The CHR$(34) forces a quotation mark into the command string
':Yithout
upsetting Basic.
The procedure for a
file
name that includes a SHIFT-SPACE
is
similar, but uses
CHR$(160).
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 :
BASIC 2 FORMAT:
BASIC
3.5 FORMAT:
PRINT#l5
,"
SO
:?" SCRATCH " ?
'"
Depending on the exact problem, you may have to be very creative
in
choosing pattem-
matching characters that will affect
only the desired file, and may have
to
rename other
files first to keep them from being scratched too.
36
COPYING PROGRAMS: BASIC 2
The Copy command allows you to make a spare copy
of
any program or
file
on a
diskette. However, on a single drive like the
154
I, the copy must
be
on
the same diskette,
which means it must be given a different name from the
file
copied. It's also used to
concatenate up
to
four sequential data
file
s (combining them
by
linking one to another,
end to end
in
a chain). Files are linked in the order
in
which they appear
in
the command.
The source files and other files on the diskette are not changed. Files must be closed
before they are copied or
concatenated'.
FORMAT FOR
THE COPY COMMAND
PRINT#l5,
" COPYdrive # :new file=drive # :old
file
"
EXAMPLES:
PRINT#IS,
" COPYO:BACKUP=ORIGINAL"
or abbreviated
as
PRINT#IS,
" Cdrive
#:new
file=drive # :old file"
PRINT#
IS
, "
CO
:
BACKUP=
ORIGIN~L
"
where
"drive#"
is
the drive number (0
on
the 1541,)
"new
file"
is
the copy, and " old
file"
is
the original.
FORMAT FOR THE CONCATENATE OPTION
PRINT#
15,
"Cdrive
# :new file= drive # :file l ,drive#:file 2,drive #:file 3,drive
#:file
4"
where
"drive
#"
is
the drive number for each file. Since it
is
always 0 on the 1541, the
drive number
is
often omitted.
EXAMPLES:
After renaming a file named
"BOOT"
to
"TEMP"
in
the last section's example, we
· can use the Copy command to make a spare copy
of
the program elsewhere on the
diskette, under the original name:
PRINT#
15, "CO:
BOOT=
TEMP"
After creating several small
s~quential
files that each
fit
easily
in
memory along with
a program we are using, we can use the concatenate option to combine them
in
a master
file, even if the result
is
too big to
fit
in
memory. (Do be sure
it
will
fit
in
remaining space
on the
diskette-it
will be
as
big as the sum
of
the sizes
of
the files
in
it.)
PRINT#lS,
"CO:
A-Z=
A-G,H-M,
N-Z"
37
Comentarios a estos manuales