首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

还是函数有关问题

2012-03-23 
还是函数问题帮我解释一下这2个函数的意思,谢谢了,functionTurnBitOn(Value:IntegerBit:Byte):Integerbe

还是函数问题
帮我解释一下这2个函数的意思,谢谢了,
function   TurnBitOn   (Value:   Integer;   Bit:   Byte):   Integer;
begin
    Result   :=   Value   and   (1   shl   Bit);
end;

function   TurnBitOff   (Value:   Integer;   Bit:   Byte):   Integer;
begin
    Result   :=   Value   and   not   (1   shl   Bit);
end;

[解决办法]
TurnBitOn : 将Value这个Integer类型整数的第Bit位置为1
TurnBitOff: 将Value这个Integer类型整数的第Bit位置为0

热点排行