That declaration is not a function, it is a property, or more specifically an event. In that same class, you will see a data member named FOnProcessEvent
of type TOnProcessEventProc
. If you look at the declaration of TOnProcessEventProc
, you will see that it is an alias for a method pointer of a specific signature, eg:
type
TOnProcessEventProc = procedure(Sender: TObject; ... other parameters here ...) of object;
That means any non-static class method that matches that signature can be assigned to the OnProcessEvent
event. And if the event is declared as published
, such a method can even be assigned at design-time instead of in code at run-time.
In the code for the class that declares the event property, all it has to do is call FOnProcessEvent()
as if it were a procedure, eg:
if Assigned(FOnProcessEvent) then
FOnProcessEvent(Self, ... parameter values here ...);
Whatever method is actually assigned to FOnProcessEvent
, if any, will be called.