LoByte
 
获取操作数的最低字节。

语法

#define LoByte( expr ) (Cast(UInteger, expr ) And &h000000FF)

用法

result = LoByte( expr )

参数

expr
数值表达式,转换为UInteger值。

返回值

返回expr 的低字节值。

说明

该宏将数值表达式expr 转换为UInteger值,然后扩展为表示其最低有效(低)字节值的UInteger.

例子

Dim N As UInteger

'Note there are 16 bits
N = &b1010101110000001
Print "N is                                       "; N
Print "The binary representation of N is          "; Bin(N)
Print "The most significant byte (MSB) of N is    "; HiByte(N)
Print "The least significant byte (LSB) of N is   "; LoByte(N)
Print "The binary representation of the MSB is    "; Bin(HiByte(N))
Print "The binary representation of the LSB is    "; Bin(LoByte(N))
Sleep


输出将如下所示:
N Is                                       43905
The Binary representation of N Is          1010101110000001
The most significant Byte (MSB) of N Is    171
The least significant Byte (LSB) of N Is   129
The Binary representation of the MSB Is    10101011
The Binary representation of the LSB Is    10000001


方言差异

  • -lang qb 方言中不可用,除非使用别名__LOBYTE引用。

与QB差别

  • 新的FreeBASIC

参考