五步蛇 发表于 2015-2-2 16:01:03

这里是怎么出错的 那我指导下大神谢谢!

unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    Button5: TButton;
    Button6: TButton;
    Button7: TButton;
    Button8: TButton;
    procedure Edit1Click(Sender: TObject);
    procedure Edit2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button5Click(Sender: TObject);
    procedure Button6Click(Sender: TObject);
    procedure Button7Click(Sender: TObject);
    procedure Button8Click(Sender: TObject);
private
    { Private declarations }
public
    { Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Edit1Click(Sender: TObject);
begin
Edit1.Text := '';
end;
procedure TForm1.Edit2Click(Sender: TObject);
begin
Edit2.Text := '';
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
label1.Caption:= '+';
Edit3.Text:= FloatToStr(StrToFloat(Edit1.Text) + StrToFloat(Edit2.Text));
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Label1.Caption:= '-';
Edit3.Text:= FloatToStr(StrToFloat(Edit1.Text) - StrToFloat(Edit2.Text));
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
Label1.Caption := '*';
Edit3.Text := FloatToStr(StrToFloat(Edit1.Text ) * StrToFloat(Edit2.Text ));
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
Label1.Caption := '/';
Edit3.Text :=FloatToStr(StrToFloat(Edit1.Text ) / StrToFloat(Edit2.Text ));
end;
procedure TForm1.Button5Click(Sender: TObject);
begin
Label1.Caption := 'And';
Edit3.Text :=IntToStr(StrToInt(Edit1.Text ) And StrToInt(Edit2.Text ));
end;
procedure TForm1.Button6Click(Sender: TObject);
begin
Label1.Caption := 'Not';
Edit3.Text :=IntToStr(StrToInt(Edit1.Text ) Not StrToInt(Edit2.Text ));   ///unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    Button5: TButton;
    Button6: TButton;
    Button7: TButton;
    Button8: TButton;
    procedure Edit1Click(Sender: TObject);
    procedure Edit2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button5Click(Sender: TObject);
    procedure Button6Click(Sender: TObject);
    procedure Button7Click(Sender: TObject);
    procedure Button8Click(Sender: TObject);
private
    { Private declarations }
public
    { Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Edit1Click(Sender: TObject);
begin
Edit1.Text := '';
end;
procedure TForm1.Edit2Click(Sender: TObject);
begin
Edit2.Text := '';
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
label1.Caption:= '+';
Edit3.Text:= FloatToStr(StrToFloat(Edit1.Text) + StrToFloat(Edit2.Text));
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Label1.Caption:= '-';
Edit3.Text:= FloatToStr(StrToFloat(Edit1.Text) - StrToFloat(Edit2.Text));
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
Label1.Caption := '*';
Edit3.Text := FloatToStr(StrToFloat(Edit1.Text ) * StrToFloat(Edit2.Text ));
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
Label1.Caption := '/';
Edit3.Text :=FloatToStr(StrToFloat(Edit1.Text ) / StrToFloat(Edit2.Text ));
end;
procedure TForm1.Button5Click(Sender: TObject);
begin
Label1.Caption := 'And';
Edit3.Text :=IntToStr(StrToInt(Edit1.Text ) And StrToInt(Edit2.Text ));
end;
procedure TForm1.Button6Click(Sender: TObject);
begin
Label1.Caption := 'Not';                                                   
Edit3.Text :=IntToStr(StrToInt(Edit1.Text ) Not StrToInt(Edit2.Text ));      //出错的是这句!
end;
procedure TForm1.Button7Click(Sender: TObject);
begin
Label1.Caption := 'Xor';
Edit3.Text :=IntToStr(StrToInt(Edit1.Text ) Xor StrToInt(Edit2.Text ));
end;
procedure TForm1.Button8Click(Sender: TObject);
begin
Label1.Caption := 'Or';
Edit3.Text :=IntToStr(StrToInt(Edit1.Text ) Or StrToInt(Edit2.Text ));
end;
end.
end;
procedure TForm1.Button7Click(Sender: TObject);
begin
Label1.Caption := 'Xor';
Edit3.Text :=IntToStr(StrToInt(Edit1.Text ) Xor StrToInt(Edit2.Text ));
end;
procedure TForm1.Button8Click(Sender: TObject);
begin
Label1.Caption := 'Or';
Edit3.Text :=IntToStr(StrToInt(Edit1.Text ) Or StrToInt(Edit2.Text ));
end;
end.

comeheres 发表于 2015-2-2 20:40:09

对位运算符没有理解

五步蛇 发表于 2015-2-5 13:28:08

好的我明白了 怎么结贴啊?

五步蛇 发表于 2015-2-5 13:29:28

好的我明白了 怎么结贴啊?
页: [1]
查看完整版本: 这里是怎么出错的 那我指导下大神谢谢!