EasyManua.ls Logo

Commodore 1581 - Demonstration of Sequential Files (BASIC 7.0)

Commodore 1581
138 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...
DEMONSTRATION
OF
SEQUENTIAL
FILES
(BASIC
7.0)
Use
the
following
program
for
your
first
experiments
with
sequen
tial files.
Comments
have
been
added
to
help
you
better
understand
it.
150CR$
=
CHR$(13)
170
PRINT
CHR$(147):REM
CLEAR
SCREEN
190
PRINT
"**
WRITE
A
FILE
**"
210
PRINT
220
DOPEN
#2,"@SEQ
FILE",W
230
GOSUB
500
240
PRINT'ENTER
A
WORD,
THEN
A
NUMBER"
250
PRINT'OR
'END,0'
TO
STOP"
260
PRINT
270
INPUT
A$,B
280
PRINT#2A$;CR$;B
290
GOSUB
500
300
IF
A$O"END"
THEN
270
310
PRINT
320
DCLOSE
#2
340
PRINT
"**
READ SAME
FILE
BACK
**"
360
PRINT
370
DOPEN
#2,"SEQ
FILE"
380
GOSUB
500
390
INPUT#2A$3
400RS
=
ST
410
GOSUB
500
420
PRINT
A$,B
430
IF
RS
=
0
THEN
390
440
IF
RSO64
THEN
PRINT"STATUS
=
";RS
450
DCLOSE
#2
460
END
480
REM
**
ERROR
CHECK
S/R
**
500
IF
DS>0
THEN
PRINT
DS$:STOP
510
RETURN
Make
a
carriage
return
variable
Open
demo
file
with
replace
Check
for
disk
errors
Accept
a
string
&
number
from
keyboard
Write
them
to
the
disk
file
Until
finished
Tidy
up
Reopen
same
file
for
reading
Read
next
string
&
number
from
file
Remember
file
status
Display
file
contents
until
done,
unless
there's
an
error
Then
quit
51

Table of Contents

Other manuals for Commodore 1581

Related product manuals