Click or drag to resize

SwapWord Function

Exchange the right and left halves of a word.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.5
Syntax
 FUNCTION SwapWord(
	wSwap AS WORD
) AS WORD

Parameters

wSwap
Type: UInt16
The word whose bytes you want to swap.

Return Value

Type: UInt16
The swapped word.
Remarks
SwapWord() swaps the right half of a word with the left half of a word and returns the result.
Examples
This example uses SwapWord():
X#
1aHex := 0xAB00
2? SwapWord(aHex)            // returns 171
See Also