07-31-2024, 12:24 AM
I dunno. The current behavior makes perfect sense to me. If this was a datafile on a disk, the way it'd behave is:
Before ever reading any information from that file, it's all nul -- chr$(0).
You read 5 bytes from that file, but this is a set length 8 byte record. You get those 5 bytes + 3 blank spaces.
The LEN should always report 8, as the reserved length of space in memory is 8 bytes. If you want to know how many characters that are that aren't leading or trailing CHR$(0) or CHR$(32), then you need to write a routine to filter those out yourself, just as you would if you only wanted numeric numbers from a customer's address. "1234 Fartwood Lane.".... filter out anything not a 0 to 9, and you're left with "1234".
The way it's behaving seems to make perfect sense to me. Maybe I'm just the odd one here?
Before ever reading any information from that file, it's all nul -- chr$(0).
You read 5 bytes from that file, but this is a set length 8 byte record. You get those 5 bytes + 3 blank spaces.
The LEN should always report 8, as the reserved length of space in memory is 8 bytes. If you want to know how many characters that are that aren't leading or trailing CHR$(0) or CHR$(32), then you need to write a routine to filter those out yourself, just as you would if you only wanted numeric numbers from a customer's address. "1234 Fartwood Lane.".... filter out anything not a 0 to 9, and you're left with "1234".
The way it's behaving seems to make perfect sense to me. Maybe I'm just the odd one here?