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

Home » Public Forums » archive » Way to determine big/little endian?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Way to determine big/little endian? [message #26664] Wed, 19 September 2001 21:13
Mark Rivers is currently offline  Mark Rivers
Messages: 49
Registered: February 2000
Member
Is there a built-in way to determine if the machine IDL is running on is
big-endian or little-endian? I would expect that there might be a field in
!version, but there is not.

Here is what I am doing to set the Boolean value "big_endian":

; If this is a big-endian machine swap the byte order
; I don't know of a built-in IDL test for endianness, do it ourselves
t1 = 1
t2 = 1
byteorder, t2, /sswap, /swap_if_big_endian
big_endian = (t1 ne t2)
if (big_endian) then str = swap_endian(str)


Is there a simpler way? It would be nice if swap_endian accepted the
/swap_if_big_endian and /swap_if_little_endian keywords the way byteorder
now does.

Mark Rivers
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Free-hand ROIs using DRAW_WIDGET
Next Topic: Re: Variable undefined after while-cycle?

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

Current Time: Wed Oct 08 14:32:45 PDT 2025

Total time taken to generate the page: 0.00539 seconds