Delphi中取某整数的某位的位状态的小函数
type
TPosRange=0..32;
TStateResult=0..1;
function GetBitSate(Source:Integer;Pos:TPosRange):TStateResult;
begin
Result:=((Source and (1 shl Pos))shr Pos);
end;
type
TPosRange=0..32;
TStateResult=0..1;
function GetBitSate(Source:Integer;Pos:TPosRange):TStateResult;
begin
Result:=((Source and (1 shl Pos))shr Pos);
end;