我在书中看到一句程序不明?请大家帮忙!!! a为int64型, 为什么会出现a:=a or (1 shl I)??
下面程序中a为int64型,为什么会出现a:=a or (1 shl I);,它是什么意思?结果又是什么??
procedure TUserManageForm.BitBtn3Click(Sender: TObject);
var i: integer; a: int64;
begin
a := 0;
for i := 0 to qx.Items.Count - 1 do
if qx.Checked[i] then
a := a or (1 shl i); //这句是什么意思?结果又是什么??
a := a shl 10;
a := a xor 1234567890;
if adodm.tuser.Locate('用户编号', intptr(man.Selected.Data^).id, []) then
begin
adodm.tuser.Edit;
adodm.tuser.FieldByName('用户权限').Asstring := inttostr(a);
adodm.tuser.Post;
intptr(man.Selected.Data^).qx := a;
end
else
showmessage('没有找到,请重新输入!');
end;