FORMAT FOR SAVE WITH REPLACE:
SAVE"@Drive #:file
name",
device #
where all the parameters are
as
usual except for adding a leading
"at"
sign (@.) The
"drive
#:"
is required here.
EXAMPLE:
SA VE"@O:REVISED PROGRAM"
,8
The actual procedure
is
that the new version
is
saved completely, then the old version
is
erased. Because it works this way, there is little danger a disaster such
as
having the
power going off midway through the process would destroy both the old and new copies
of
the file. Nothing happens
to
the old copy until after the new copy is saved properly.
Caution--do not use @SAVE on
an
almost-full diskette. Only use it when you have
enough room on the diskette to hold a second complete copy
of
the program being
replaced. Due
to
the way @SAVE works, both the old and new versions
of
the
file
are
on
disk simultaneously at one point,
as
a way
of
safeguarding against loss
of
the program.
If
there
is
not enough room left
on
diskette
to
hold that second copy, only
as
much
of
the
new version will be saved
as
there
is
still room for. After the command executes, a look at
the directory will show the new version
is
present, but doesn't occupy enough blocks
to
match the copy in memory. Unfortunately, the VERIFY command (see below) will not
detect this problem, because whatever was saved will have been saved properly.
VERIFY
Although not
as
necessary with a disk drive
as
with a cassette, BASIC's VERIFY
command can be used to make doubly certain that a program
file
was properly saved
to
disk. It works much like the LOAD command, except that it only compares each character
in the program against the equivalent character in the computer's memory, instead
of
actually being copied into memory.
If
the disk copy
of
the program differs even a tiny bit from the copy in memory,
"VERIFY ERROR" will be displayed, to tell you that the copies differ. This doesn't
mean either copy is bad, but if they were supposed to
be
identical, there
is
a problem.
Naturally, there's
no
point in trying to VERIFY a disk copy
of
a program after the
original is no longer in memory. With nothing
to
compare to,
an
apparent error will
always be announced, even though the disk copy is always and automatically verified
as
it
is
written to the diskette.
FORMAT FOR THE VERIFY COMMAND:
VERIFY "drive#:pattern" ,device#,relocate
flag
where
"drive#:"
is
an optional drive number, "pattern" is any string expression that
evaluates
to
a
file
name, with or without pattern-matching characters, and
"device#"
is
the disk device number, normally 8.
If
the relocate
flag
is
present and equals
1,
the
file
will be verified where originally saved, rather than relocated into the BASIC text area.
17