Click or drag to resize

SwapWord Function

X#
Exchange the right and left halves of a word.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.19
Syntax
 FUNCTION SwapWord(
	wSwap AS WORD
) AS WORD
Request Example View Source

Parameters

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

Return Value

Type: Word
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