新手vip完成的作业,给点指导。
下边是修改后的源码:unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure Swap_fun(var str_a:String ; var str_b:String);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
str1: String;
str2: String;
begin
str1:= Edit1.Text;
str2:= Edit2.Text;
Swap_fun(str1, str2);
Edit1.Text:= str1;
Edit2.Text:= str2;
end;
procedure TForm1.Swap_fun(var str_a:String ;var str_b:String);
var
temp: String;
begin
temp:= str_a;
str_a:= str_b;
str_b:= temp;
end;
end.
Good!! 楼主加油,我们都看好你哦。 楼主加油,我们都看好你哦。
页:
[1]