EasyManua.ls Logo

Commodore RF512C - Random Access File

Commodore RF512C
52 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...
33
RANDOM
ACCESS
FILE
It is also
calied
RELATIVE
FILE
in this
sys
tem.
Programmer
can
easy build-
up
t
he
file structure
in
to fields
and
records without take
care
of
the
who
le file
in
program.
T.he relative file
is
es
tablished by
six
side-sectors
and
each
side-
sector has it
data
pointer
th
at
po
int to individual
data
block.
Acco
r
ding
to its formal, some
DOS
utl
iti
es
can't
work
no
rmally.
The
fo
ll
ow
ing
demo
pr
ogr
am
shows
you how to cr
ea
t
e,
wirte
and
read
the relative f
il
e.
10
DOPEN#
1.
"
REL,L
20"
20
RECORD#
1,30
30
DCLOSE
1
40
FOR
1=1
TO
10
50
DOPEN#
1.
"
REL
,L
20"
60
INPU
T"
NAME
- ";
NA$
70
IF
LEN(NAME
$) > 10
THEN
60
80
INPUT
"
TEL
- :"
;TEL
$
90 IF
LEN[TEL
$»
10
THEN
80
100
D$=NAME$
+CHR$
(13)
+TEL$
110
RECORD#
1,D$
120
PRINT#
1,
D$
130
DC
LO
SE 1
140
NE
XT I
150
FOR
1=1
TO
10
160
DOPENiI'
1,
"
REL
,20"
1
70
RECORD#'
1,
(1),
1
180
INPUTii'
1,
NAME
$
,TEL
$
190
PRINT
NAME$
;
':"':',
TEL
$
200
DCLO
SE 1
210
NE
XT I
LINE
10
to
30:
Create
REL
fil
e
LINE
40 to
140:
Write ten pairs of
data
onto it
LINE
150
to
210:
Re
ad
da
ta
back
fr
om
file
Because user
can
easily r
edef
ine the record length.
So,
no
append
function
is
need
s.