I have been wondering about this nasty feature, that bothers me every once in a while when I try to read binary files on MSX-BASIC.
Is it a known (or maybe even documented) feature, that when you check EOF and there is CHR$(0) character in a file you may loose a character?
I'm not really sure, but if I remember correctly this bug can be repeated on CAS: device as well. It is anyway more than 10 years, when I played with cassettes.
Below you can find an example of this bug. If you replace the CHR$(0) with any other value you get the correct value "6" now you will get "3" If you replace the character count with odd number, you get "Input past end" error, that should newer happen with this code.
10 OPEN "test.tmp" FOR OUTPUT AS #1
20 PRINT#1,STRING$(6,CHR$(0));
30 CLOSE
40 OPEN "test.tmp" FOR INPUT AS #1
50 R$=INPUT$(1,1):L=L+1
60 IF NOT EOF(1) THEN 50
70 CLOSE
80 PRINTL
Any ideas?
~NYYRIKKI