I need to execute an procedure of an object if his exists, i'm doing some
tests and get into this, but this is generating an SIGSEV:
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
type
{ TTeste }
TTeste = class
procedure Proc;
end;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
type
TProc = procedure of object;
implementation
procedure DoProc(Sender: TObject);
var
Proc: TProc;
begin
Proc := TProc(Sender.MethodAddress('Proc')^);
Proc;
end;
{ TTeste }
procedure TTeste.Proc;
begin
ShowMessage('oi');
end;
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
begin
DoProc(TTeste.Create);
end;
end.
2012/3/27 Everton Vieira <[email protected]>
> Is there any how to list the procedures of a object?
> Att.
> Everton Vieira.
>
--
Everton Vieira.
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus