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

Home » Public Forums » archive » Re: Determining machine endian-ness
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: Determining machine endian-ness [message #12143 is a reply to message #12129] Wed, 01 July 1998 00:00 Go to previous messageGo to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Mark Rivers (rivers@cars3.uchicago.edu) writes:

> Is there a way to determine whether the machine on which IDL is executing is
> big endian or little endian? I am trying to read a data file which I know
> contains little-endian data. I need to byte swap this data if IDL is running
> on a big-endian machine, but not byte-swap if it is running on a little-endian
> machine.
>
> It would be nice there were a field in !VERSION which contained this
> information. Right now I am testing if !VERSION.ARCH eq 'x26', 'alpha', etc.
> There must be a better way.

I see in the IDL 5.1 on-line help that there are keywords
SWAP_IF_BIG_ENDIAN and SWAP_IF_LITTLE_ENDIAN to the
BYTEORDER procedure that allow conditional byte ordering depending
upon the "endianness" of the machine IDL is running on. Sounds
like just the ticket. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Important object lesson
Next Topic: Re: Using ASSOC function

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

Current Time: Sun Oct 12 04:24:21 PDT 2025

Total time taken to generate the page: 1.27913 seconds