Random Access File - Commodore RF512C Operational Manual

Disk drive
Table of Contents

Advertisement

33
RANDOM ACCESS FILE
It is also calied
RELATIVE FILE
in this system.
Programmer can easy bui ld -up the file structure into fields and
records without take care of the whole file in program.
T .he relative file is established
by
six side-sectors and each side-
sector has it data pointer
that point
to ind ividual data b lock.
According to its
formal,
some
DOS
utlities can't work normally.
The fo llowing demo p
rogra
m shows you how to c reate, wirte and
read the re la tive file.
10
DOPEN#
1.
" REL,L20"
20
RECORD#
1,30
30
DCLOSE
1
40
FOR 1
=
1
TO
10
50
DOPEN#
1.
" REL,L20"
60
INPUT"
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
DCLOSE
1
140
NEXT I
150
FOR 1
=
1
TO
10
160
DOPENiI'
1, " REL,20"
170
RECORD#'
1,
(1),1
180
INPUTii'
1,NAME$,TEL$
190
PRINT
NAME$; ':"':', TEL$
200
DCLOSE 1
210
NEXT I
LINE
10 to 30:
Create
REL
file
LINE
40 to 140:
Write ten pairs of data onto it
LINE
150 to 210:
Rea
d data back from file
Because user can easi ly redefine the record length. So, no
append function is needs.

Hide quick links:

Advertisement

Table of Contents
loading

Related Products for Commodore RF512C

This manual is also suitable for:

Rf502cRf501c

Table of Contents