I
ivanmorgan
Unregistered / Unconfirmed
GUEST, unregistred user!
unit Unit3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function total{x,y:integer}:integer;
begin
total:x+y;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
x,y,z:integer;
begin
x:=2;
y:=3;
z:=total{x,y};
label1.Caption :=inttostrz{z} ;
end;
end.
运行的时候报错在这一行
total:x+y;
不知道那边错了
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function total{x,y:integer}:integer;
begin
total:x+y;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
x,y,z:integer;
begin
x:=2;
y:=3;
z:=total{x,y};
label1.Caption :=inttostrz{z} ;
end;
end.
运行的时候报错在这一行
total:x+y;
不知道那边错了