是一个类似计算器的东西 为什么用integer声明变量就出错呢?代码如下:
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Label3: TLabel;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
var
num1: Integer;
num2: Integer;
num3: Integer;
begin
num1:= edit1.Text;
num2:= edit2.Text;
num3:= num1+num2;
edit3.Text:=num3;
end;end.在线等谢谢了
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Label3: TLabel;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
var
num1: Integer;
num2: Integer;
num3: Integer;
begin
num1:= edit1.Text;
num2:= edit2.Text;
num3:= num1+num2;
edit3.Text:=num3;
end;end.在线等谢谢了
解决方案 »
- 根据url获取json
- 谁有delphi 中安装quickexport的详细说明
- 请教一下delphi方面adodateset 中设置空字段后在 cxGrid1DBTableView1显示checkbox间的问题
- 学到什么程序可以出去面试去呀。
- 在delphi中如果实现把ACCESS数据表转化为EXCEL表格形式?
- 各位高手有解决内存泻漏的方法和工具吗!
- ??图书馆管理系统??
- 请问delphi中如何动态创建ACCESS 数据庫
- 小女子正在写一个销售系统,有几个问题:
- 如何在应用程序中屏蔽Alt+F4等功能键?
- underclare identifier IOleContainer 应该引用哪个单元?
- 请问这样的sql语句在delphi中如何执行?如何写成sql中的函数或过程?
num1(integer类型):= edit1.Text(字符串类型);num1:= strtointdef(edit1.Text,0);
....edit3.Text:=inttostr(num3);
num2:= integer(edit2.Text);
num3:= integer(num1+num2);这么些可以吗?那这个edit3.Text:=num3; 怎么写?我没什么基础 麻烦了