EasyManua.ls Logo

Commodore 1541-II - Expanding a Relative File

Commodore 1541-II
104 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
1410OPEN
l,8,2,4t0:"+FI$+",L,"
1420
GOSUB
59990
1430RH
=
INT(NR/256)
1440RL
=
NR-256*RH
1450PRINT#15,t4P"
+
CHR$(96
+
2)
+
CHR$(RL)
+
CHR$(RH)
1460
GOSUB
59990
1470
PRINT#1,CHR$(255);
1480
GOSUB
59990
1490PRINT#15/'P"
+
CHR$(96
+
2)
+
CHR$(RL)
+
CHR$(RH)
1500
GOSUB
59990
1510
CLOSE
1
1520
GOSUB
59990
9980
CLOSE
15
9990
END
59980
REM
CHECK
DISK
SUBROUTINE
59990
INPUT#15,EN,EM$,ET,ES
60000
IF
EN>1
AND
ENO50
THEN
PRINT
EN,EM$,ET,ES:STOP
60010
RETURN
Begin
to
create
desired
file
Check
for
disk
errors
Calculate
length
values
Position
to
last
record
number
Send
default
character
to
it
Re-position
for
safety
Now
the
file
can
be
safely
closed
And
the
command
channel
closed
Before
we
end
the
pro
gram
Ignore
"RECORD
NOT
PRESENT"
Two
lines
require
additional
explanation.
When
line
1470
executes,
the
disk
drive
will
operate
for
up
to
ten
or
more
minutes,
creating
all
the
records
in
the
file,
up
to
the
maximum
record
number
you
selected
in
line
1390.
This
is
normal,
and
only
needs
to
be
done
once.
During
the
process
you
may
hear
the
drive
motor
turning
and
an
occasional
slight
click
as
the
head
steps
from
track
to
track,
everything
is
probably
just
fine.
Second,
line
60000
above
is
different
from
the
equivalent
line
in
the
error
check
subroutine
given
earlier.
Here
disk
error
number
50
is
specifically
ignored,
because
it
will
be
generated
when
the
error
channel
is
checked
in line
1460.
We
ignore
it
because
not
having
a
requested
record
would
only
be
an
error
if
that
record
had
previously
been
created.
EXPANDING
A
RELATIVE
FILE
What
if
you
underestimate
your
needs
and
need
to
expand
a
relative
file
later?
No
problem.
Simply
request
the
record
number
you
need,
even
if
it
doesn't
currently
exist
in
the
file.
If
fthere
is
no
such
record
yet,
DOS'
will
create
it
as
soon
as
you
try
to
write
information
in
it,
and
also
automatically
create
any
other
missing
records
below
it
in
number.
The
only
penalty
will
be
a
slight
time
delay
while
the
records
are
created.
60

Table of Contents

Related product manuals