Bug in MSX-BASIC. (Development Foros MSX)MSX Resource Center            
                       
English Nederlands Espa�ol Portugu�s Russian                  
 Noticias
   Página principal
  Almacén de noticias
  Temas de noticias

 Recursos
   Foros MSX
  Artículos
  Analisis
  Informe de ferias/RUs
  Álbum de fotos
  Ferias y encuentros
  Encuestas
  Enlaces
  Buscar

 Software
   Descargas
  Tienda Online

 MRC
   Quiénes somos
  Únete a nuestro equipo
  Donar
  Políticas
  Contacta con nosotros
  Enlázanos
  Estadísticas

 Buscar
 
  

  

 Login
 

Login

Contraseña




¿Aún no tienes una cuenta? ¡Conviértete en miembro del MSX Resource Center! ¡Únete a nosotros!.


 Estadísticas
 

Hay 46 invitados y 1 miembro en línea

Eres un usuario anónimo.
 

Foros MSX


Foros MSX

Development - Bug in MSX-BASIC.

Autor

Bug in MSX-BASIC.

NYYRIKKI
msx master
Mensajes: 1525
Publicado: Agosto 30 2003, 14:43   

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
Arjan
msx addict
Mensajes: 472
Publicado: Septiembre 07 2003, 13:54   
It's probably an undocumented feature I think INPUT$ was made to read textdata from a file, not binary data. It will also fail if you put the value 26 (EOF marker) in a file, so using INPUT$ is useless for reading binary data.
GuyveR800
msx guru
Mensajes: 3048
Publicado: Septiembre 07 2003, 15:35   
Good thinking!
 
 







(c) 1994 - 2008 Fundación MSX Resource Center. MSX es una marca registrada de MSX Licensing Corporation