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 #76 background imageLoading...
Page #76 background image
Chapter
71
Disk Files
5.
Convert string values back to numbers using the "convert"
functions: CVI for integers, CVS for single precision values,
and CVD for double precision values. For example:
PRINT
N$
PRINT CVS(A$)
The program may now access the data in the buffer.
The following program accesses the direct access file
list-
ing.dat
(created with the previous program). When BASIC ex-
ecutes Line 30, enter any
valid
record number from
1isting.dat.
This program prints the contents of that record.
10 OPEN
"R",
1,
"ll5tlng.dat",
32
20 FIELD 1,20
AS
N$,4
AS
A$,8
AS
P$
30 RECSIZE%
=
32
50 IF CODE% =0
OR
CODE%
>
(LOF(l)/RECSIZE%) THEN
1000
60 GET
#I,
CODE%
70 PRINT
N$
80 PRINT USING
'I$$#.##";
CVSCA$)
90 PRINT P$: PRINT
100 GOT0 40
1000 CLOSE
1
40 INPUT "2-DIGIT CODE, 0 TO END"; CODE%
After typing this program, save it and run it. When BASIC
asks you
to
enter
a
2-digit code, enter 20 (the record created
through the previous program). Your display should show:
2-DIGIT CODE, 0
TO
END? 20
SM
I
TH
$34.55
567-9000
To update
listing.dat,
simply use LOAD to load the previous
program (the one that created
listing.dat)
and run it.
74

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