procedure swap(x, y: string);
var
temp: string;
begin
temp := x;
x := y;
y := temp;
end;
procedure TForm1.Button3Click(Sender: TObject);
var a,b:string;
begin
a:=Edit1.Text;
b:=Edit2.Text; {赋值}
swap(a,b); {数值对换}
Edit1.Text:=b; {读取数值}
Edit2.Text:=a;
end;
var
temp: string;
begin
temp := x;
x := y;
y := temp;
end;
procedure TForm1.Button3Click(Sender: TObject);
var a,b:string;
begin
a:=Edit1.Text;
b:=Edit2.Text; {赋值}
swap(a,b); {数值对换}
Edit1.Text:=b; {读取数值}
Edit2.Text:=a;
end;