主要代码:
var
Form2: TForm2;
AA,BB:string;
CC:Integer;implementation
{$R *.dfm}
procedure TForm2.init;
begin
AA:= 'A';
BB:= 'B';
CC:= 1;
end;procedure TForm2.Button1Click(Sender: TObject);
begin
init;
proc1(AA,BB,CC);
Outmsg(Memo1);
end;procedure TForm2.Button2Click(Sender: TObject);
begin
init;
proc2(AA,BB,CC);
Outmsg(Memo2);
end;procedure TForm2.proc1(var A,B:string; var C:Integer);
begin
A:= 'Z';
B:= 'X';
C:= 99;
end;procedure TForm2.proc2(var A:string; B:string; C:Integer);
begin
A:= 'Z';
B:= 'X';
C:= 99;
end;procedure TForm2.Outmsg(mmo: TMemo);
begin
mmo.Lines.Add(AA);
mmo.Lines.Add(BB);
mmo.Lines.Add(IntToStr(CC));
end;
运行结果: