Click or drag to resize

SwapShort Function

X#
Exchange the right and left halves of a short integer.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.21
Syntax
 FUNCTION SwapShort(
	siSwap AS SHORT
) AS SHORT
Request Example View Source

Parameters

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

Return Value

Type: Short
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#
1? SwapShort(-10000)                // -3880
See Also