- 47 -
LSET/RSET
Function Transfers data to the buffer for a random file. (In preparation for the PUT statement)
Format LSET <character variable> = <character expression>
RSET <character variable> = <character expression>
Term <character variable>: The character variable used for the assignment in the FIELD
statement.
<character expression>: The character string to be transferred
Explanation When the character string to be transferred is shorter than the number of characters
assigned in the FIELD statement, the character string to be transferred is left-justified
and right-justified in the LSET statement and RSET statement, respectively. For the
FIELD statement, it is right-justified. Blanks are filled with spaces in all of these
statements.
When the character string to be transferred is longer than the number of characters
assigned in the FIELD statement, it is left-justified in both LSET statement and the
RSET statement. Note that excess characters are lost from the right side of the
character string at this time.
The LSET statement and the RSET statement can also be used for a variable other
than the variable assigned in the FIELD statement. In this case, the required number
of characters should be previously assigned to a variable as dummies.
Ex.)
110 A$=SPACE$(20)
120 RSET A$=N$
The above indicates that the character string N$ is right-justified in the variable area
consisting of 20 characters.
These statements are useful for arranging the print format.
Numeric data cannot be used for the LSET statement and RSET statement if it is not
converted into character data. To convert numeric data into character data, the MKI$
and MKS$ functions should be used.