[Gambas-user] READ file problem - bug

nando nando_f at ...951...
Thu May 12 21:53:49 CEST 2005


One of my programs has uses a data file
where the first two bytes in the file 
were written as a SHORT (2 bytes) with
the value 999 (base 10)

When my program starts,
part of the initialization is to read this SHORT.

I have a problem because the SHORT value
read in is -6397  which happens to be exactly
the BIG ENDIAN representation of 999

The 999 was initially written LITTLE ENDIAN as a SHORT
and when I use KHexEdit, viewing the beginning of
the data file, I see 999 (decimal) LITTLE ENDIAN
and when I click to see BIG ENDIAN, it is -6397.
I specicially open the file as READ LITTLE.

This is a repeatable problem I encounter.
I have verified this a few times before writing this.

Perhaps I doing something wrong.


More information about the User mailing list