Vector Basic Interpreter Basic 80 Reference Manual - page 149
of
190
Do not. use
a
variable
in
st.at.ement..
point.er
for
point.
int.o
inst.ead
of
buffer.
FIELDed
st.ring
an
INPUT
or LET
This
causes
the
that. variable
to
st.ring
space
the
random
file
10 OPEN
"R"i1,"FILE"
20 FIELD
.1,20
AS N$,
4 AS A$,
8 AS P$
30 INPUT
"2-0IGIT
COOE";COOE\
40 INPUT
"NAME" ;X$
SO
INPUT
"AMOUNT";AMT
60 INPUT
"PHONE";TEL$:PRINT
70 LSET
N$=X$
80 LSET
A$-MKS$(AMT)
90 LSET
P$=TEL$
100 PUT
t1,CODE\
110 GOTO
30
5.3.2.2
Access
A Random
File
-
The
following
program
st.eps are required
t.o access
a
random
file:
Use" the FIELD
st.atement.t.o
allocat.e space
in the random
buffer
for t.he variables
that
will
be read
from
the
file.
FIELD
#1 20 AS N$,
4 AS A$,
8 AS
P$
NOTE:
In a program
that. performs
both
input. and out.put.on the same
random
file,
you
can
oft.en use
just
one
OPEN
st.atement and one FIELD
st.at.ement.