Save With Replace; Verifying Programs - Commodore 1541 User Manual

Hide thumbs Also See for 1541:
Table of Contents

Advertisement

SA VE WITH REPLACE OPTION
If
the
disk
cop.~
0
~
the
pr~gram
differs
even a tiny bit from the copy in memory
,
•VERIFY
ER~OR
wil!
be
d1 spla~ed
,
to tell you that the
copies
differ.
This
in itself
oesn'I
mean
either copy 1
s
bad
,
but 1f they were supposed to be identical
,
one or
the
other
If
a file already exists
,
it
can'
t be saved again because the disk ~nly allows
o~e
c~as a
problem
.
,
.
.
.
of any given file name per
diskette.
It is possible to get around this problem
using
q
Naturally
'
there
~
no point in trying to verify a disk copy of a program after the
Rename and Scratch commands described later. However, if all you wish to do is repJ ·ginal is
no
longer in memory
.
With nothing to compare to
,
an
apparent error will
a program or data file with a revised version
,
another command is more convenieqways
be
announ~ed
,
even though the disk copy
is always
and automatically verified
as
it
Known as Save-with-replace
,
or
@ Save,
this option tells the disk to replace
any
file,
Wfitten
to
the disk
.
finds in the directofy with the same name
,
substituting the new file for it.
oRMAT
FOR
THE VERIFY COMMAND
:
FORMAT FOR SA VE WITH
REPLACE:
FORMAT FOR SA VE
WITH
REPLAQ
BASIC
2
BASIC
3.5
VERIFY "drive # :pattern
"
,device#
,
re!ocate flag
SAVE "@Drive # :file
name",
device#
DSAVE "
@
file name
" ,
Ddri
ve
1
Udevice #
here '_'drive
#
:" is
an optional drive number (0 on the 1541,)
"
pattern
" is
any string
1
press1on
that
evaluates
to a file name, with or without pattern-matching characters and
where all the parameters are as usual except for adding
_
a leading
_ " at'_' sign_(@.
) 7
device
#" is
the disk
devi~e
number,
normally
8.
If
the
relocate flag is presen; and
" O:"
in the Basic 2 version
,
though a holdover from earlier dual drives is
required h
uals
l, the file
will be venfied where originally saved
,
rather than relocated into the
a
ic
text
area.
EXAMPLES
:
useful
alternate
form of the command
is:
SAVE" @O:REVISED PROGRAM"
,8
DSAVE
"@REVISED PROGRAM
"
VERIFY
"*
'',device#
The actual procedure is that the new version is saved completely
,
then the old
veru
is scratched
,
and
its
directory entry altered to point to the new version
.
Because
it w
verifies
the last
file
used
without
having
to type its
name
or drive
number.
However it
this way
,
there is little
,
if any
,
danger that a disaster such as having the power goingon't
work properly
after save-with-replace
,
because the last file used was the dne
midway through the process would destroy both the old and new copies of
the leted,_
and the
drive will try to compare the deleted file to the program in memory
.
No
Nothing happens to the old copy until after the new copy is saved properly·
.
~will
~suit,
but
'
'
VERIFY ERROR
'
' will always be announced. To use verify after
However,
we do offer one caution-<lo not use
@
Save on an almost-full
disk
AVE, include
at least part of the file name that is to be verified in the pattern
.
Only use it when you
have
enough room on the diskette to hold a second
complete
cop
,
One
other note
about Verify-when you Verify a relocated file
,
an error will nearly
the program being replaced
.
Due to the way
@
Save works
,
both the old and new vernways_
be
announced,
due to changes in the link pointers of Basic programs made during
of the file
are
on disk simultaneously at one
point,
as a way of safeguarding
against
IOlloc~tion.
It is
best to only verify files saved from the same type of machine and
the program
.
If there is not enough room left on diskette to
hold
that second copy
,
onJt~tical
m~mory
size. For example
,
a Basic program saved from a VIC 20
can'
t easlly be
much of the new version will be saved on the 1541 as there is still room for.
Afteinfi~
using
a Commodore 64, even when the program would work fine on both
command completes
,
a look at a directory will
~how
the new version is
present,~~~s_
(unless
the
progr~
is
re-saved).
This shouldn't
matter,
as the only time you'll
doesn't occupy enough
blocks
to match the copy in memory
.
Unfortunately
• the V
_
Ymg files
on machines other than the one which wrote them is when you are
command (see next section) will
not
detect this problem
,
because however much
dil".1f~ng
two disk
files to see if they
are
the same
.
This
is done by loading one and
n Ymg
a
·
h
saved will have been saved properly
.
:rno
.
gamst
t e
other,
and as suggested
,
can only be done on the same machine and
ry
size
as the
one on which the files were first created
.
VERIFYING PROGRAMS
L
<\SING
OLD PROGRAMS: BASIC
2
Although not
as
necessary with a disk drive as with a
cassette, Basic's Vf
Sc
command can be used to make doubly certain that a program file was properly
sav
Upi:tch command allows you to
erase
unwanted
files,
and free the
space they
disk .• It works much like
the.
Load
com~and,
except
tha~
it only
compai;esJC
Via
for use by
oth_
e r
files.
It can be used to erase either a single file
,
or several
files
at
character in the program agamst the equivalent character m the computer
s
pattern-matching
.
ory, instead of actually being copied into memory.
30
31

Advertisement

Table of Contents
loading

Table of Contents