ObjectPascal:定义函数并求和;
function total(x,y:integer):integer;
begin
total:=x+y;
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
Var x,y,z:integer;
begin
x:=3;
y:=5;
z:=total(x,y);
label1.Caption:=inttostr(z);
end;
function total(x,y:integer):integer;
begin
total:=x+y;
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
Var x,y,z:integer;
begin
x:=3;
y:=5;
z:=total(x,y);
label1.Caption:=inttostr(z);
end;