EasyManua.ls Logo

Commodore 1541 - Page 46

Commodore 1541
80 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...
So
far,
all
it
does
is
create the
file
and
the
first
record,
but
doesn't
actually
put
any
data
in
it.
Below
is
a
greatly
expanded
version
of
ihe
program,
to actually
allow
you
to
work
with
a
mailing
list
where
the records
arc
coded by
numbers.
■I
OPEN
RELATIVE
FILE
CALLED
V'MAILINO
LIST"
10
OPEN1,8,15:OPEN2,8,3,"0:MAILING
LIST.L, "
+
CHR$(10i
20
PRINT#l."P"CHR$(3
+
96)CHRS(l)CHR$(0)CHRS(l):INPUTfl2,XS:
X=VAL(XS):
X
=
0THEN
X
=
2
30
INPUT "READ,WRITE,OR
END";JS:IF
JS
=
"E'THEN
CLOSE2'
CLOSE
I:
END
40
IFJ$
=
"W"THEN200
CrEAD
ROUTINE
50
PR1NT:INPUT
"RECORD
#";R:IF
R<0 OR
R>X
THEN
50*^
60
IF
R<2THEN
30
70
Rl
= R:R2
=
0:IF
Rl>256
THEN
R2=
INT
(R1/256):R1
=R1
-
256-R2
80
RESTORE:DATAI,FIRST
NAME.14.LAST
NAME,30,ADDRESSl
51
ADDRESS2
90
DATA72,CITY,85,STATE,88,ZIP,98,PHONE#
100
FOR
L=1TO8:READ
A,AS:PRINT#l,"P"CHR$(3
+
96)
(R1)CHR$(R2)
HR$(A):GOSUB900
s-s\r
110
ON
A/50
GOTO50
(
WRITE
routine
115
INPUTfl2,ZS:PRINT
AS,ZS:NEXT:GOTO50
200
PRINT:INPUT
"RECORD
#";R:IF
R<0
OR
R>500
THEN
200-1
210
IF
R<2THEN
30
215
IFR>KTHEN
R =
X
+
I:PRINT:PR1NT
"RECORD/T;R
220
Rl
= R:R2 =
0:IFR>255THEN
R2=
INT
(R1/256):RI
=
R1-256-R2
230
RESTORE:FOR
L=
IT08:READ
A.AS^RlNTfll.-'P-'CHRSg
+
gfi)
CHR$(R1)CHR5(R2)CHR$(A)
232
GOSUB900
235
PRINT
A$;:1NPUT
Z$:IF
LEN(ZS)>A(L)
THEN
Z$
=
LEFT$(Z$,A(L))
240
IjRINT#2,ZS:GOSUB900:NEXTiIF
R>X
THEN
X
=
]
245
PRINT#l,"P"CHR$(3
+
96)CHRS(l)CHR$(0)CHR$(l)
250
PRINT#2,X:GOSUB900:GOTO200
900
INPUT#l,A,BS,C,D:IFA<20THEN
RETURN
910
IF
AO50THEN
PRINT
A;B$,C;D:STOP:RETURN
920
IF
JS="R"
THEN
PRINT
BS
930
RETURN
This
program
asks
for
record
numbers
when
retrieving
records.
It
won't
let
you
retrieve
from
beyond
the
end
of
the
file,
and
if
you
try
to
write
beyond
the
end
it
forces
you
to
write
on
the
next higher
record.
A
more
advanced
version
than
this
would
keep
track
of
the
items
by
"keys",
to
index
the
records.
For
example,
you
would
probably
want
to
search
for
a
record
by
name,
or
print
out
labels
by
zip
code.
For
this
you
would
need
a
separate
list
of
keys
and
record
numbers,
probably
stored
in
sequential
files.
40
ERROR
CHFXKING
SUBROUTINE

Other manuals for Commodore 1541

Related product manuals