Below is a single record write to a random access file with the consol screen output below.
Why is the read back only 18 bytes when the write string is 20 bytes
from the LEN = 20. Are these 2 missing bytes the string length?
#COMPILE EXE
'#DIM ALL
FUNCTION PBMAIN () AS LONG
OPEN "f:\pb35\new.dat" FOR RANDOM AS #1 LEN =20
A$ = "12345678911234567892"
St% = LEN(A$)
PRINT St%, A$
PUT #1,1,A$
CLOSE #1
OPEN "F:\pb35\new.dat" FOR RANDOM AS #2 LEN=20
GET #2,1,B$
Stb% = LEN( B$)
PRINT Stb%,B$
INPUT C$
END FUNCTION
20 12345678911234567892
18 123456789112345678
Why is the read back only 18 bytes when the write string is 20 bytes
from the LEN = 20. Are these 2 missing bytes the string length?
#COMPILE EXE
'#DIM ALL
FUNCTION PBMAIN () AS LONG
OPEN "f:\pb35\new.dat" FOR RANDOM AS #1 LEN =20
A$ = "12345678911234567892"
St% = LEN(A$)
PRINT St%, A$
PUT #1,1,A$
CLOSE #1
OPEN "F:\pb35\new.dat" FOR RANDOM AS #2 LEN=20
GET #2,1,B$
Stb% = LEN( B$)
PRINT Stb%,B$
INPUT C$
END FUNCTION
20 12345678911234567892
18 123456789112345678
Comment