Delphi中取某整数的某位的位状态的小函数

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 joinchina 的 blog

type

   tposrange=0..32;

      tstateresult=0..1;

function getbitsate(source:integer;pos:tposrange):tstateresult;

begin

   result:=((source and (1 shl pos))shr pos);

end;

本文关键:Delphi中取某整数的某位的位状态的小函数
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top