以下代码仅仅是测试代码:delphi XE7 UP1
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
type
TForm1 = class(TForm)
btn1: TButton;
btn2: TButton;
edt1: TEdit;
procedure btn1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
TMethod = procedure(v:string);
var
Form1: TForm1;
FList: TList;
implementation
{$R *.dfm}
procedure p1(v:string);
begin
ShowMessage('p1'+v);
end;
procedure p2(v:string);
begin
ShowMessage('p2'+v);
end;
procedure callt(my:TMethod;v:string);
begin
my(v);
end;
procedure TForm1.btn1Click(Sender: TObject);
var
v_s:string;
be

这篇博客探讨了在Delphi XE7 Update 1中如何使用函数指针和回调函数。通过示例代码,展示了在实际应用中如何实现和调用这些功能。
最低0.47元/天 解锁文章
685

被折叠的 条评论
为什么被折叠?



