unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
Tfunc=procedure of object;
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
procedure testfunc;
public
{ Public declarations }
test:Tfunc;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.testfunc;
begin
showmessage('aa');
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
test:=testfunc
//将函数付给变量
test
//调用变量函数
end;
end.