아래소스를 돌리면 이런 에러가 나네요...
[Error] Unit1.pas(41): Incompatible types: 'regular procedure and method pointer'
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
procedure myproc;
procedure callproc(p: TProcedure);
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.callproc(p: TProcedure);
begin
p;
end;
procedure TForm1.myproc;
var
i : shortint;
begin
i := 0;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
callproc(myproc); --> 여기에서 에러가 발생합니다.
end;
end.
|