EasyManua.ls Logo

Commodore 1541 - Page 45

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...
Let's
assume
we
have
a
mailing
list.
The
list
consists
of
8
pieces
of
data,
according
to
this
chart:
Field
Name
first
name
last
name
address
line
1
address
line
2
city
state
zip
code
phone
number
Le
12
15
20
20
12
2
9
10
TOTAL
100
This
is
how
the
record
length
is
determined.
We
would
probably
want
to
allow
an
extra
character
in
length
for
each
field,
to
allow
for
separations;
otherwise
the
INPUTS
command
would
pick
up
a
much
longer
piece
of
the
file
than
needed,
just
like
in
se
quential
files.
Therefore,
we'll
set
up
a
file
with
a
length
of
108
characters
per
record.
In
the
first
record,
we'll
put
the
number
1,
representing
the
largest
records
used
so
far.
Here
is
the
program
as
described
so
far:
5
X
=
0
10
OPENl.8,15
20
OPEN2,8,3,"0:MA1L1NG
LIST,L, "
+
CHRS(108)
30
GOSUB900
40
PR1NT#1,"P"CHRS(3
+
96)CHR$(1)CHRS(O)CHRJ(1)
50
GOSUB900
60
1FE
=
50THENPRINT#2,1:GOT040
70
1NPUTS2.X
75
PRINT
X
300
STOP:CLOSE1;CLOSE2;END_
900
INPUT#1,E,BS,C,D'
910
IF
(E
=
50)
OR
(E<20)
THEN
RETURN
920
PRINT
E;BS;C;D:STOP:RETURN
Error
#50
which
is
checked
in
line
60 of
the
program
is
Ihe
RECORD
NOT
PRE
SENT
error,
which
means
that
the
record hadn't
been
created
yet.
Writing
into
the
record
will
solve
the
problem.
This
error
condition
must be watched
carefully
within
your
programs.
39

Other manuals for Commodore 1541

Related product manuals