Delphi> Please explain this: type... procedure of object

Posted by Richard Woolf on Stack Overflow See other posts from Stack Overflow or by Richard Woolf
Published on 2011-01-07T14:42:08Z Indexed on 2011/01/07 14:53 UTC
Read the original article Hit count: 296

Filed under:

I've encountered some code that's new to me...

I've never really seen a type declaration of a procedure of object, and I just don't see the point. Why couldn't the developer simply keep a field of type Boolean?

interface

    type
      TFinishedCaptureEvent = procedure(AFinished: Boolean) of object;

      TFrameCard = class(TFrame)
      ...
      private
        FOnFinishedCapture: TFinishedCaptureEvent;
      public
        property OnFinishedCapture: TFinishedCaptureEvent read FOnFinishedCapture write FOnFinishedCapture;
      end;    

implementation

  ...

  if Assigned(FOnFinishedCapture) then
        FOnFinishedCapture(False);  

© Stack Overflow or respective owner

Related posts about delphi