主题:问个问新手问题
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;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
function ji(myadd:integer;myadded:integer):integer;
implementation
{$R *.dfm}
function ji(myadd:integer;myadded:integer):integer;
begin
ji:=myadd * myadded;
end
procedure TForm1.Button1Click(Sender: TObject);
var
myadd,myadded,myji :integer;
begin
myadd:=strtoint(edit1.Text );
myadded:=strtoint(edit2.Text );
myji:=ji(myadd,myadded);
edit3.Text := inttostr(myji);
shoumessage('Á½¸öÊýµÄheÊÇ'+inttostr(myji);
end;
end.
写个两个数相加。运行出错。请大家帮我改一下。
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;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
function ji(myadd:integer;myadded:integer):integer;
implementation
{$R *.dfm}
function ji(myadd:integer;myadded:integer):integer;
begin
ji:=myadd * myadded;
end
procedure TForm1.Button1Click(Sender: TObject);
var
myadd,myadded,myji :integer;
begin
myadd:=strtoint(edit1.Text );
myadded:=strtoint(edit2.Text );
myji:=ji(myadd,myadded);
edit3.Text := inttostr(myji);
shoumessage('Á½¸öÊýµÄheÊÇ'+inttostr(myji);
end;
end.
写个两个数相加。运行出错。请大家帮我改一下。