Click or drag to resize

SwapInt Function

Exchange the right and left halves of an integer.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.5
Syntax
 FUNCTION SwapInt(
	liSwap AS LONG
) AS LONG

Parameters

liSwap
Type: Int32
The integer whose bytes you want to swap.

Return Value

Type: Int32
The swapped integer.
Remarks
SwapInt() swaps the right half of an integer with the left half of an integer and returns the result.
The sign may not be preserved during the swap.
Examples
This example uses SwapInt():
X#
1? SwapInt(30001)        // 1966145536
See Also