小编Ism*_* Dz的帖子

获取一个字节的高4位

我试图获得a的高4位Byte.

那是我到目前为止的尝试:

function Upper4Bits(const X : Byte): Byte;
type 
   BS = set of 0..7;
var 
   K : Byte; Q: BS;
begin
  Q := [];
  for K := 0 to 3 do {is it right? upper?}
    {what i need here?}
    Include(Q, {what i put here});

  Upper4Bits := Byte(Q)
end;
Run Code Online (Sandbox Code Playgroud)

提前致谢.

delphi byte bits bit

-1
推荐指数
2
解决办法
1014
查看次数

标签 统计

bit ×1

bits ×1

byte ×1

delphi ×1