On Tue, 15 Dec 2015 14:02:48 -0800
Aradeonas <[email protected]> wrote:

>[...]
> Maybe Im tierd but could any one tell me what this code wont work:
> > program Project1;
> >
> > {$mode objfpc}{$H+}
> >
> > uses  Classes,  SysUtils;
> >
> > type
> >
> > { Tbook }
> >
> > Tbook = class  private    fnoti: TNotifyEvent;  public    property
> > noti: TNotifyEvent read fnoti write fnoti;  end;

Because
TNotifyEvent = procedure(Sender: TObject) of object;

The 'of object' means you need a method, not a procedure.


> > project1.lpr(30,13) Error: Incompatible types: got "<address of
> > procedure(TObject);Register>" expected "<procedure variable type of
> > procedure(TObject) of object;Register>"


Mattias

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to