LOBYTE
- 来源: https://www.freebasic.net/wiki/wikka.php?wakka=KeyPgLoByte
- 最后更新: 2016-02-10
获取操作数的最低字节。
语法
#define Lobyte( expr ) (Cast(Uinteger, expr) and &h000000FF)用法
result = Lobyte( expr )参数
expr
数值表达式,转换为 Uinteger 值。
返回值
返回 expr 的低字节值。
说明
该宏将数值表达式 expr 转换为 Uinteger 值,然后展开为表示其最低有效(低)字节值的 Uinteger。
示例
start GeSHi
vb
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))
Sleepend GeSHi
输出结果如下:
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 新增
另请参阅
HibyteLowordHiword
返回 目录