comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: MSB, LSB?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: MSB, LSB? [message #14441] Thu, 04 March 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
David Fanning (davidf@dfanning.com) writes:

>> Height = MSB(most significant bits) * 256 + LSB(least significant bits)

Whoops! I wrote:

> height = Byte(data, 0) * 256 + Byte(data, 1)

And I probably should have written:

height = Byte(data, 1) * 256 + Byte(data, 0)

I think I wrote my test number incorrectly. :-(

You also have to pay attention to where this data was
created and what kind of machine you are working on.
For example, if this data was created on a UNIX machine
and I'm reading it on my PC, then I have to swap the
MSB and LSB when I read the data file.

OpenR, lun, filename, /Get_Lun, /Swap_If_Little_Endian

Cheers,

David

P.S. I promise in the future to get my kids off to school
BEFORE I start answering questions on the newsgroup. :-)

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Previous Topic: hiding scrollbars
Next Topic: Re: Keyboard events in a widget

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 14:53:38 PDT 2025

Total time taken to generate the page: 2.24125 seconds