LoWord Function | |
Return the low-order (rightmost) word in a number.
Namespace:
XSharp.Core
Assembly:
XSharp.Core (in XSharp.Core.dll) Version: 2.19
Syntax FUNCTION LoWord(
dwValue AS DWORD
) AS WORD
public static ushort LoWord(
uint dwValue
)
Request Example
View SourceParameters
- dwValue
- Type: DWord
The number whose low-order word you want to get.
Return Value
Type:
WordRemarks
Related data can be stored in the high-order and low-order words of a variable.
Therefore, instead of creating and returning a 2-element array, it may be more efficient to return a double word whose 2 words contain separate information.
Also, many Windows API functions receive data in a LONGINT argument.
Usually the high-order and low-order words of this argument contain different information about a window and its messages. LoWord() can be used to extract the low-order word of this argument.
Examples
This example uses LoWord() and HiWord() to determine the coordinates of a pixel.
It assumes that liParam was passed to a Windows callback function:
1CRTSetPixel(LoWord(liParam), HiWord(liParam), 0L)
See Also