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 #74 background imageLoading...
Page #74 background image
Chapter
71
Disk
Files
3. To move data into the buffer, use the LSET statement. Nu-
meric values must be converted to strings when placed in the
buffer. To do this, use the
make
functions: MKI$
to
make an
integer value into
a
string, MKS$ for
a
single precision value,
and MKD$ for
a
double precision value. For example:
LSET
NS=XS
LSET A$=MKSSCAMT)
4.
To write data from the buffer to a record (within
a
direct ac-
cess disk file), use the PUT statement. For example:
PUT 1, CODE%
writes the data from Buffer
1
to a record with the number
CODE%.
(The percentage sign at the end of a variable speci-
fies that
it
is
an integer variable.)
The following program writes information to
a
direct access
file:
10 OPEN
"R",
1, "li5ting.dat",32
20 FIELD 1, 20
AS
NS,
4
AS
AS,
8
AS
PS
30
INPUT "2-DIGIT CODE,
0
TO END"; CODE%
40
IF CODE%
=
0
THEN 130
50
INPUT "NAME";
XS
60
INPUT "AMOUNT"; AMT
70
INPUT "PHONE"; TELS
80 LSET
NS
=
XS
90
LSET
AS
=
MKS$(AMT)
100 LSET
PS
=
TELS
110 PUT 1, CODE%
120 GOT0 30
130 CLOSE
1
The 2-digit code that you enter in Line 30 becomes a record
number. That record number stores the name(s1, amount(s1,
and phone number(s) you enter when Lines
50,
60,
and
70
are
executed. The record is written to the file when BASIC exe-
cutes the PUT statement in Line 110.
72

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