Hi all,
I got a little problem here. I'd like to assign a regular procedure into an event handler. Say I have a TForm with a TTimer. But, instead of assign the timer's event on design time, I want to assign it on run time with a regular procedure.
I've tried to do this:
...
procedure doSometing(Sender: TObject);
begin
...
end;
...
...
Timer1.OnTimer := @doSomething;
...
but it failed with "incompatible types" error. I have been searching the net without any satisfying answers because all them are using class procedure, not regular procedure.
Any hints? Or is it even possible to do so?
Thank you.
Regards,
-Bee