把整数当作布尔用

procedure TForm1.Button1Click(Sender: TObject);
var
  i: Integer;
begin
  i := 0;
  ShowMessage(IntToStr(i));  //0
  i := not i;
  ShowMessage(IntToStr(i));  //-1
  i := not i;
  ShowMessage(IntToStr(i));  //0
end;

 

你可能感兴趣的:(布尔)