打印本文 打印本文 关闭窗口 关闭窗口
Delphi中取某整数的某位的位状态的小函数
作者:武汉SEO闵涛  文章来源:敏韬网  点击数585  更新时间:2009/4/23 18:34:06  文章录入:mintao  责任编辑:mintao

type

   TPosRange=0..32;

      TStateResult=0..1;

function GetBitSate(Source:Integer;Pos:TPosRange):TStateResult;

begin

   Result:=((Source and (1 shl Pos))shr Pos);

end;

打印本文 打印本文 关闭窗口 关闭窗口