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 #75 background imageLoading...
Page #75 background image
Chapter
71
Disk
Files
After typing this program, save it and run it. Then, enter the
following data:
2-DIGIT CODE, 0 TO END? 20
IENTER]
2-DIGIT CODE,
0
TO END? 0
[ENIER)
BASIC stores
SMITH,
34.55, and 567-9000 in Record 20 of
file
1isting.bas.
Accessing
a
Direct Access File
1.
Open the file in Random mode:
OPEN
"R",
1
,"listing.dat",32
2.
Use the FIELD statement to allocate space in the buffer for
the variables that will be read from the file. For example:
FIELD
1,
20
AS
N$,
4
AS
A$,
8
AS
P$
3.
Before you use the GET statement to read the record, you can
check to see if the record is in your file. Set a variable in
your program equal
to
the record size you used in the
OPEN
statement. LOF returns the length of the file in bytes. The to-
tal number of bytes in the file divided by the record size is
equal to the largest record number in the file. An attempt
to
access
a
record number greater than the largest record num-
ber in the file results
in
an "Input past end" error.
For
example:
RECSIZE
=
32
IF
CODE%
>
(LOF(1)
/
RECSIZE%) THEN 1000
4.
Use the GET statement to read the desired record from a di-
rect disk file into a buffer. For example:
GET
1,
CODE%
gets the record numbered CODE% and reads it into Buffer
1.
73

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