Owner`s manual

20
The reason that the space used for each name and each address
is
of various lengths
is
because the data registered by sequential access are not usually
of
a fixed length; the
length varies according to the data. For the random access files, to be explained later,
all
data are stored in boxes of a fixed length
of
32
bytes.
If,
as in this example, data are
to be handled
as
one group, and, as for the addresses above,
32
bytes
is
not sufficient,
and the lengths are different, then the use
of
the sequential access file
is
convenient.
A program can be made as described below, by
INPUT command, to substitute names
and addresses alternately in string variables, register each person's file individually,
prepare an ADDRESS LIST
of
a total
of
50 people, and then read out the prepared
file
and display on the screen the names and addresses
of
10
persons at a time.
Write-in
1 0 0
WO
PEN
# 3
"F
D 1 :
ADD
RES
S
LIS
T"
........
Designation of drive
number and file name
1 1 0
FOR
I
=1
TO
5 0
120
INPUT
"name="
;NA$
130
INPUT
"address"
=
;AD$
140
PRI
NT
#3,
NA$,
AD$
...........................
Write-intofloppydisk
150
NEXT
I
160
CLOSE
#3
Read-out
200
ROPE
N
#4,
"FD1:
ADDRESS
LIST"
210
FOR
I
=1
TO
5
FOR
J
=1
TO
10
220
INPUT
#4,
NA$,
AD$
230
PRI
NT
NA$
:
PRI
NT
AD$
240
NEXT
J
250
PRI
NT
"
PUSH
SPACE
KEY"
260
GET
X$
F
X$
"
THEN
280
270
GO
TO
260
280
NEXT
I
290
PRI
NT
"END"
300
CLOSE
#4
,