Hello Dan,

The most common if not the best way is to use nil. This because the
agreement. In a buttonClick the event handler expect a button but not
something else. Of course there can be exceptions but making away from
this habitudes can be difficult if you at later time have to do a
maintenance and has forgot what object has passed.

in the event hanlder itself it should be (in case it can be called
without sender):

if Assigned(Sender) then
  ...

It is in fact the same for many other procedures. If some pointer is nil
then dont execute. That's a very common way to program.

Speaking of execution time it will not do mutch or even nothing..

---
Rgds, Wilfried
http://www.mestdagh.biz

__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi-talk

Reply via email to