接:遇到一个问题: 象$D7、$08是不是代表十六进制? 如何计算一个表达式?
有一个表达式 : _Vol := _Vol or $08 or _Sound;
在未计算之前 : _Vol =7 , _Sound =7
计算后的结果是: _Vol =15可是我不知道是如何计算出来的?而我按照十六进制的计算是
_Vol 7 0000 0111
$08 8 or 0000 1000
0000 1111
_Sound 7 or 0000 0111
结果: 0000 1111
即十六进制的OF请问_Vol := _Vol or $08 or _Sound;是如何计算的????????
有一个表达式 : _Vol := _Vol or $08 or _Sound;
在未计算之前 : _Vol =7 , _Sound =7
计算后的结果是: _Vol =15可是我不知道是如何计算出来的?而我按照十六进制的计算是
_Vol 7 0000 0111
$08 8 or 0000 1000
0000 1111
_Sound 7 or 0000 0111
结果: 0000 1111
即十六进制的OF请问_Vol := _Vol or $08 or _Sound;是如何计算的????????
_Vol 7 0000 0111
$08 8 or 0000 1000
0000 1111
_Sound 7 or 0000 0111
结果: 0000 1111
即十六进制的OF 转化成整数是多少呢?当然是15!
If the operands of an and, or, or xor operation are both integers, the result is of the predefined integer type with the smallest range that includes all possible values of both types.
• 若and、or 或xor 的运算数都是整数类型,则它的返回类型是包含运算数所有可能的值、且范围最小的预定义(内置)整数类型;
即十六进制的OF 转化成十进制整数是15!