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.
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.
NOTE: The contents of variablei are overwritten by the result.
a = '1234'X
b = a
BYTEORDER, b, /Sswap PRINT, Format='(2Z9)', a, b
1234 3412
a = '12345678'XL b = a BYTEORDER, b, /Lswap PRINT, Format='(2Z9)', a, b
12345678 78563412