User`s guide

NOTE: Dual drives make fuller use
of
this command, copying programs from one diskette
to another
in
a single disk unit. To do that on the 1541, refer
to
Appendix E
to
find
the
programs that you need.
COPYING
PROGRAMS:
BASIC
3.5
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
1541, the copy must
be
on
the same diskette,
which means
it
must be given a different name from the
file
copied. The source
file
and
other files on the diskette are not changed. Files
.bust be closed before they are copied.
Although the
1541
supports a Concatenate option, Basic 3.5 doesn't have a special
command for it. The Basic
2 syntax from the previous page may be used instead.
FORMAT
FOR THE COPY COMMAND
COPY Ddrive
#,"old
file" to Ddrive
#,"new
file",Udevice #
where
"D"
is
the drive number (always 0 on the 1541,)
"new
file"
is
the copy,
"old
file"
is
the original, and
"U"
is
the device number.
If
omitted, the drive number defaults
to
0 and the device number (unit) to
8.
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:
COPY
"TEMP"
TO
"BOOT"
To copy a
file
on a second disk drive, we would use:
COPY
"ORIGINAL"
TO
"BACKUP'',U9
NOTE: Dual drives make fuller use
of
this command, copying programs from one diskette
to another
in
a single disk unit. To do that on the 1541, refer to Appendix E to
find
the
programs that you need.
VALIDATING
THE
DISKETTE:
BASIC
2
The Validate 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 re-use, and
all improperly-closed files are automatically Scratched. However, this bare description of
its workings doesn't indicate either the power or the danger of the Validate command. Its
wer
is
in
restoring to
g,)()d
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 available on a fresh diskette, Validate is
needed, with one exception below. Similarly, any time a diskette contains
an
improperly-
38
sed
file
(splat file), indicated
by
an asterisk(*) next
to
its
file
type
in
the directory, that
clo
· bel · · ood "d t
. kette needs to be validated. ln fact, but for the one
exception ow,
It
1s
a g 1 ea o
dis
· d bo h · · "t
rdate diskettes whenever you are the least
bit conceme a
ut
t eir mtegn y.
va
1
The exception
is
diskettes containing Direct Access files, as described
in
Chapt~r
7 ·
,
6
t direct access (random) files do not allocate their sectors
in
a way the Validate
JVIOS
I .
ornmand can recognize. Thus, using Validate on such a diskette may resu t m un-
:nocating
all
direct access files, with loss
of
all their c?ntents
wh~n
other files.
a:e
ad~ed
.
Unless specifically instructed otherwise, never use Validate on a diskette contammg direct
access files. (Note: these are
not the same as the relative files described
in
Chapter 6.
Validate may be used on relative files without difficulty.)
FORMAT
FOR THE VALIDATE COMMAND
PRINT#
15,'
'V
ALIDA TEO''
or
abbreviated as
PRINT#l5,"VO"
where
"O"
is
the drive number (always 0 on the 1541.)
As
usual,
it
is
assumed
file
15
has
been
opened to the command channel on the 1541.
EXAMPLE:
PRINT#l5
,"VO'
VALIDATING
THE
DISKETTE:
BASIC
3.5
The Collect command
in
Basic 3.5
is
the same
as
the Validate command
in
Basic 2.
It 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 re-use, and all improperly-closed files are
automatically Scratched. However, this bare description of
its
workings doesn't indicate
either the power or the danger
of
the Collect 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
block~
shown as free don't add
up
to
the 664 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
the least bit concerned about their integrity. Just note the number
of
blocks free
in
the
diskette
's
directory before and after using Collect, and
ifthe
totals differ, there was indeed
a problem, and the diskette should probably be copied onto a fresh diskette
file
by
file,
using the Copy command described
in
the previous section, rather than usiqg a backup
command or program . .
The exception
is
diskettes containing Direct Access files,
as
described
in
Chapter 7 ·
Most
direct access (random) files do not allocate their sectors
in
a way Collect can
recognize. Thus, collecting such a diskette may result
in
un-allocating all direct access
39