LSET
I LSET field name = data
Statement
I
Sets data
in
a direct-access buffer field name.
Before using LSET,
you
must have used FIELD to set
up
buffer fields.
See also the chapter
on
"Disk Files", OPEN, CLOSE, FIELD, GET,
PUT, and RSET.
Example
Suppose NM$ and AD$ have been defined
as
field names for a direct
access file buffer. NM$ has a length of
18
characters; AD$ has a
length of 25 characters. The statements
LSET
NM$
= "JIM CRICKET,
JR."
LSET
AD$
=
"2000
EAST
PECAN
ST."
set the data
in
the buffer
as
follows:
JIM~CRICKET,JR.~~~
2000~EAST~PECAN~ST.~~~~~~
Notice that filler blanks were placed to the right of the data strings
in
both cases.
If
we
had used RSET statements instead of LSET, the
filler spaces would have been placed
to
the left. This is the only
difference between LSET
and
RSET.
If
a string item
is
too large
to
fit
in
the specified buffer field, it is
always truncated
on
the right. That
is,
the extra characters
on
the
right are ignored. This applies
to
both LSET
and
RSET.
2-124