Click or drag to resize

SwapShort Function

Exchange the right and left halves of a short integer.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.2a
Syntax
 FUNCTION SwapShort(
	siSwap AS SHORT
) AS SHORT
View Source

Parameters

siSwap
Type: Int16
The short integer whose bytes you want to swap.

Return Value

Type: Int16
The swapped short integer.
Remarks
SwapShort() swaps the right half of a short integer with the left half of a short integer and returns the result.  The sign may not be preserved after the swap.
Examples
This example uses SwapShort():
X#
? SwapShort(-10000)                                // -3880
See Also