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 #73 background imageLoading...
Page #73 background image
Chapter
71
Disk Files
BASIC allocates space for records in numeric order. That is,
if
the first record you write to the file is number 200, BASIC allo-
cates space for records 0 through 199 before storing record 200
in the file.
The maximum number of logical records is 16,777,215. Each
record may contain a minimum of
1
and and a maximum of
3 2
7
68 bytes.
The statements and functions used with direct access files are:
OPEN FIELD LSETiRSET
CLOSE GET PUT
MKD$ MKI$ MKS$
CVD CVI
cvs
LOC LOF
These statements and functions are discussed in more detail in
Chapter 10.
Creating a Direct Access File
1.
To create the file, open it for random access in Random mode
(''R').
For example:
OPEN
"R",
1,
"listing.dat",
32
opens the file named
listing.dat,
gives Buffer
1
direct access
to
the file, and sets the record length
to
32 bytes.
(If
you omit
the record length, the default is 128 bytes.) Remember that
data is passed
to
and from the disk in records.
2. Use the FIELD statement
to
allocate space in the buffer for
the variables that will be written to the file. This is neces-
sary because you must place the entire record into the buffer
before putting it into the disk file. For example:
FIELD
1,
20
AS
N$,4
AS
A$,8
AS
P$
allocates the
first
20 positions in Buffer
1
to
string variable
N$,
the next
4
positions to A$, and the next
8
positions to
P$.
The variables
N$,
A$, and
P$
are now "field names."
71

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