Board index » delphi » Objects on the fly

Objects on the fly

Hi, out there,

can somebody tell me the syntax for assigning function members ?

Var Jinx: TJinx;

Jinx := TJinx.Create( Self);

Jinx.Height := 10;
Jinx.OnJinxEvent := ??????????

Thanks a lot!

 

Re:Objects on the fly


Quote
Kai Peters wrote:

> Hi, out there,

> can somebody tell me the syntax for assigning function members ?

> Var Jinx: TJinx;

> Jinx := TJinx.Create( Self);

> Jinx.Height := 10;
> Jinx.OnJinxEvent := ??????????

> Thanks a lot!

Functions are just like any other pascal type. If there is a function
within the scope, and the declaration is compatible to the onJinxEvent
function, you can assign it to that.

Tprocedure = procedure(...) of object;

var theProcedure : TProcedure;

procedure aRealProcedure(...);
...

theProcedure:=aRealProcedure;

I hope this is correct, :-)

N.

Other Threads