BYTEORDER Procedure
Converts integers between host and network byte ordering. This procedure can also be used to swap the order of bytes within both short and long integers.
Usage
Input Parameters
Output Parameters
Keywords
Htonl
Host to network, longwords.
Htons
Host to network, short integers.
Lswap
Longword swap. Always swaps the order of the bytes within each longword. For example, the four bytes within a longword are changed from (B0,B1,B2,B3) to (B3, B2,B1, B0).
Ntohl
Network to host, longwords.
Ntohs
Network to host, short integers.
Sswap
Short word swap. Always swaps the bytes within short integers. The even and odd numbered bytes are interchanged.
Discussion
NOTE: The contents of variablei are overwritten by the result.
Examples
a = '1234'X
b = a
BYTEORDER, b, /Sswap
PRINT, Format='(2Z9)', a, b
a = '12345678'XL
b = a
BYTEORDER, b, /Lswap
PRINT, Format='(2Z9)', a, b
See Also


doc@boulder.vni.com
Copyright © 1999, Visual Numerics, Inc. All rights
reserved.