EasyManua.ls Logo

Apple IIe - Page 223

Apple IIe
320 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...
Cassette
and
Disk Storage with
the
Apple lie
223
Opening and Closing A Random Access File
The
following
configuration
is
used
to
open
a
random
access file:
Configuration
OPEN filename, Lxx [ ,
Sx
,
Vx
,
Dx]
L
is
known
as
the
length
parameter. L
is
a
required
parameter
which
denotes
the
length
of
each
random
access
record
. L can
range
from
1
io
32767.
The
CLOSE
statement
is
used
to
close a
random
access
file
just
as
it
is
used
to
close a sequential file.
Reading and Writing to Random
Files
The
following
configuration
is
used
to
read
from
or
write
to a
random
access
file
.
Configuration
READ filename, Rxx [ ,
Sx
,
Vx
,
Dx]
WRITE filename, Rxx [ ,
Sx
, Yx,
Dx]
R
is
known
as
the
record
parameter.
R moves
the
file
pointer
to
the
beginning
of
the
specified
record
.
The
follow_ing
program
illustrates
reading
from
and
writing
to
a
random
file.
10 D$ = CHR$
(4)
20
PRINT D$; " OPEN
RANDOM
,
L20
"
30
PRINT D$: "WRITE
RANDOM
,
R2
"
40
PRINT "RECORD
NUMBER
TWO
"
50
PRINT D$; " WRITE
RANDOM
,
R3
"
60
PRINT "THIS
IS
RECORD 3"
70
PRINT D$; " WRITE
RANDOM
,
R1
"
80
PRINT " RECORD 1t
90
PRINTD$;
" WRITE
RANDOM
,
R4
"
100 PRINT
''
RECORD 4"
110 PRINT D$; " CLOSE
RANDOM
"
120
GOTO
180
130 PRINT D$; " OPEN
RANDOM
,
L20
"
140 PRINT D$; " READ
RANDOM
, R
";
R

Other manuals for Apple IIe

Related product manuals