鱼C论坛

 找回密码
 立即注册
查看: 2297|回复: 3

[已解决]这里是怎么出错的 那我指导下大神谢谢!

[复制链接]
发表于 2015-2-2 16:01:03 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
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.
最佳答案
2015-2-2 20:40:09
对位运算符没有理解
2015-02-02_204138.png
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2015-2-2 20:40:09 | 显示全部楼层    本楼为最佳答案   
对位运算符没有理解
2015-02-02_204138.png
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 1 反对 0

使用道具 举报

 楼主| 发表于 2015-2-5 13:28:08 | 显示全部楼层
好的我明白了 怎么结贴啊?
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2015-2-5 13:29:28 | 显示全部楼层
好的我明白了 怎么结贴啊?
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-11-22 17:56

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表