Thread: Reversing bytes
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
simonc simonc is offline
external usenet poster
 
Posts: 52
Default Reversing bytes

Thanks for this but I'd prefer to do the conversion in the code. If I read
the two bytes into a byte array with

Get #1, , read_two_bytes(2)
Get #1, , read_two_bytes(1)

is there a way of converting the byte array to the integer value?

"Gary''s Student" wrote:

You can use DEC2BIN() to convert the value to a bit string(s), then use
MID()'s to separate the individual bits. Apply a conversion algorithm and
then re-construct the bits.
--
Gary''s Student - gsnu200731


"simonc" wrote:

I'm reading 16bit integers from a binary file and putting the values into a
spreadsheet. Unfortunately the binary file is big-endian, so all my extracted
integer values are wrong. What is the neatest way of reversing the bytes then
converting the number to an integer?

Grateful for help.