HiByte Function | |
Return the high-order (leftmost) byte in a number.
Namespace:
XSharp.Core
Assembly:
XSharp.Core (in XSharp.Core.dll) Version: 2.21
Syntax FUNCTION HiByte(
wValue AS WORD
) AS BYTE
public static byte HiByte(
ushort wValue
)
Request Example
View SourceParameters
- wValue
- Type: Word
The number whose high-order byte you want to get.
Return Value
Type:
ByteRemarks
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 word whose 2 bytes contain separate information.
Examples
This example applies HiByte() and LoByte() to a binary number.
It also displays the high-order and low-order portions of the binary number as 2 separate numbers:
1bHi := HiByte(0b0000000011111111)
2bLow := LoByte(0b0000000011111111)
3
4? 0b00000000
5? bHi
6
7? 0b11111111
8? bLow
See Also