unit2.
unit Unit2;
interface
uses Dialogs, StrUtils;
procedure sayhelloto(yourname:string);
implementation
procedure sayhelloto(yourname:string);
var hello:string;
begin
hello:=yourname+',hello!';
ShowMessage(hello);
end;
end.
unit1.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,StrUtils;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
uses Unit2;
procedure TForm1.Button1Click(Sender: TObject);
begin
Form1.Caption:=ReverseString(Edit1.Text);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Unit2.sayhelloto('liqing');
end;
end.
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment