Radio Shack TRS-80 Trsdos & Disk Basic Reference Manual page 139

Micro computer system
Hide thumbs Also See for TRS-80:
Table of Contents

Advertisement

DISK
BASIC
LSET
and
RSET
(place
data
in
a
random
buffer
field)
LSET
var$
= exp$ and
RSET
var$
= exp$
where
var$
is
a
field
name
exp$
contains the data to
be placed
in
the buffer
field
named
by
var$
These
two
statements
let
you
place character-string data into
fields
previously
set
up by
a
FIELD
statement.
For
example, suppose
NM$
and
ADS
have been
defined
as field
names
for a
random
file
buffer.
NM$
has
a
length
of 18
characters,
and
ADS
has
a
length
of
25
characters.
Now
we
want
to place the following
information
into the buffer
fields
so
it
can be
written to
disk:
name:
JIM
CRICKET,
JR.
address:
2000
EAST PECAN
ST.
This
is
accomplished with
the
two
statements:
LSET NM*=
M
JIM CRICKET,
JR.
"
LSET
flD$="2000
EAST PECRN
ST.
"
This puts the data
in
the buffer
as
follows:
JIMtfCRICKET,JR.#tf
2000#EAST#PEC
AN#
ST.###tf
NM$
AD$
Note
that
filler
spaces
were
placed
to
the
right
of the data
strings
in
both
cases. If
we
had
used
RSET
instead
of
LSET
statements, the
filler
spaces
would
have
been
placed
on
the
left.
This
is
the
only
difference
between
LSET
and
RSET.
For
example:
RSET NM*=" JIM CRICKET,
JR.
"
RSET AD*="2000 ERST PECAN
ST.
H
places
data
in
the
fields as
follows:
W0JIMflCRICKET,JR.
NM$
0lOTW2OOOflEAST#PECANflST.
AD$
7-53

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents