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

Home » Public Forums » archive » Re: Flipping Integer*2
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
Re: Flipping Integer*2 [message #1488] Tue, 21 September 1993 18:43
geomagic is currently offline  geomagic
Messages: 22
Registered: November 1993
Junior Member
In article <Sep21.220101.48083@yuma.ACNS.ColoState.EDU> dean@phobos.cira.colostate.edu writes:

> I have a data base created on a VAX/VMS machine with values that are
> integer*2. I am attempting to read these files from a PC using IDL, but
> the numbers are all wrong. I suspect I need to flip the bytes in the
> integer*2 to get the right number. Can someone tell me how to do this
> with IDL.

You need to use BYTEORDER:

ROUTINE:
BYTEORDER, Variable_1, ..., Variable_n

DESCRIPTION:
BYTEORDER converts integers between host and network byte
ordering or floating-point values between the native format
and XDR (IEEE) format. This routine can also be used to
swap the order of bytes within both short and long integers.
If the type of byte swapping is not specified via one of the
keywords below, bytes within short integers are swapped
(even and odd bytes are interchanged).

Dan O'Connell
geomagic@seismo.do.usbr.gov
Seismotectonics Group, U.S. Bureau of Reclamation
Denver Federal Center, P.O. Box 25007 D-3611, Denver, CO 80225
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Flipping Integer*2
Next Topic: Visualization '93 Conference Announcement and Program

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

Current Time: Wed Oct 08 19:51:36 PDT 2025

Total time taken to generate the page: 0.00468 seconds