unit PubUnit;
interface
uses
Windows, Messages, SysUtils;
Procedure MyProc;
Function MyFun:Boolean;
implementation
Procedure MyProc;
begin
end;
Function MyFun:Boolean;
begin
result:=true;
end;
end.
保存扇面的代码到pub.PAs
unit Unit1; //需要调用“我的函数”的单元
interface
uses
Windows, Messages, SysUtils,...
type
TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
uses
pub.pas; // 在此引用;
procedure tform1button1click();
begin
myproc;
showmessage(inttostr(integer(myfun)));
end;
...