If I write a long string into a FIELD var and then write a short string the longer part of the previous string remains.
bwBASIC: AUTO
10 OPEN "R", #1, "JUNK.DAT", 64
20 FIELD#1, 64 AS C_NAME$
30 LSET C_NAME$ = "JON WAS HERE AND THEN HE LEFT"
40 ?C_NAME$
50 LSET C_NAME$ = "JOE"
60 ?C_NAME$
^C
bwBASIC: RUN
JON WAS HERE AND THEN HE LEFT
JOE WAS HERE AND THEN HE LEFT
The purpose of LSET and RSET are to left or right justify content into a FIELD variable, padding the remaining space with " “.
It hasn’t been tested but RSET is likely broken too. :-(
If I write a long string into a `FIELD` var and then write a short string the longer part of the previous string remains.
```
bwBASIC: AUTO
10 OPEN "R", #1, "JUNK.DAT", 64
20 FIELD#1, 64 AS C_NAME$
30 LSET C_NAME$ = "JON WAS HERE AND THEN HE LEFT"
40 ?C_NAME$
50 LSET C_NAME$ = "JOE"
60 ?C_NAME$
^C
bwBASIC: RUN
JON WAS HERE AND THEN HE LEFT
JOE WAS HERE AND THEN HE LEFT
```
The purpose of `LSET` and `RSET` are to left or right justify content into a `FIELD` variable, padding the remaining space with " ".
It hasn't been tested but `RSET` is likely broken too. :-(
If I write a long string into a
FIELD
var and then write a short string the longer part of the previous string remains.The purpose of
LSET
andRSET
are to left or right justify content into aFIELD
variable, padding the remaining space with " “.It hasn’t been tested but
RSET
is likely broken too. :-(Apparently LSET is broketo LSET doesn't fill the field 2 years agoConfirmed the above code in BASICA returns:
LSET doesn't fill the fieldto LSET (RSET?) doesn't fill the field 2 years agoThis is fixed in commit
1db6c116