Re: Flipping Integer*2 [message #1488] |
Tue, 21 September 1993 18:43 |
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
|
|
|