举个例子,注意这里fun函数,是放在interface中,但不在TForm1的类定义中:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;
function fun(ap:integer):integer;
var
Form1: TForm1;
implementation
{$R *.DFM}
function fun(ap:integer):integer;
begin
Result:=1;
end;
end.