EasyManuals Logo

Tandy 1000 Basic Reference Manual

Default Icon
411 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #70 background imageLoading...
Page #70 background image
Chapter
71
Disk
Files
Creating
a
Sequential Access File
1.
To create the file, open it in Output mode (with the letter
0)
and assign it a buffer number in the range
1
to
15.
For
example:
OPEN
"O",
1,
"li5t
.dat"
OPEN "list.
dat"
FOR
OUTPUT
AS
1
Either form of the syntax for the OPEN statement opens a se-
quential output file named
list.&t
and gives Buffer
1
access
to this file.
2.
To input data from the keyboard into
1
or more program vari-
ables, use either INPUT
or
LINE INPUT. For example:
LINE INPUT, "NAME?
";
N$
inputs data from the keyboard and stores it in variable N$.
3.
To write data to the file, use the WRITE# statement (you
also can use PRINT#, but be sure you delimit the data).
For
example:
WRITE# 1,
N$
writes variable N$ to the file, using Buffer
1
(the buffer used
to
open the file). Remember that data must
go
through a
buffer before it can be written
to
a file.
4.
To ensure that all the data has been written
to
the file, use
the
CLOSE
statement. For example:
CLOSE
1
closes access
to
the file that uses Buffer
1
(the same buffer
used to open the file).
Sample Program
10
OPEN
"O",
1,
"115t.dat"
20
LINE INPUT "ENTER
A
NAME
OR
'DONE' TO END
>
30
IF N$
=
"DONE" THEN
60
40
WRITE# 1,
N$
50
PRINT: GOT0
20
60
CLOSE
1
";N$
68

Table of Contents

Other manuals for Tandy 1000

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Tandy 1000 and is the answer not in the manual?

Tandy 1000 Specifications

General IconGeneral
ProcessorIntel 8088
Processor Speed4.77 MHz
RAM128 KB (expandable to 640 KB)
Operating SystemMS-DOS 2.11
ManufacturerTandy Corporation
Release Year1984
StorageSingle or double 5.25" floppy disk drive (360 KB), optional hard drive
SoundTandy 3-voice sound
PortsParallel, Serial
GraphicsCGA (Color Graphics Adapter)
Graphics Modes320x200, 640x200

Related product manuals