ok so lets say i call an OnNotify event handler from somwhere besides 
its parent component's event trigger, and the handler doesn't (and won't 
ever) need to know where it was sent from.

is it in any way faster to set the Sender:TObject parameter to nil as 
opposed to Self? its just a pointer in the AX register either way, 
right? (unless you set stack frames {$W}, but even then the overhead is 
the same?).

ok lets say the handler DOES check where it's called from. something like:

  if (Sender is TBitBtn) then ,,,

if Sender is nil, or Sender is Self.. is one way faster/better than the 
other?

I used to think that nil was the way to go if one just needs to put in a 
dummy for Sender just to make a call. but i see a lot of people code 
where they use Self. couldn't Self be a long pointer in some instances? 
or even unavailable, or at least .. something different depending on 
where its referred to? like in a DLL for example. the DLL code will 
never know what the real Self of the application is unless the handle is 
passed somehow, and even then, it's not the Self of the DLL segment. .. 
or..?

anyway my instinct says to use nil, for lack of any reason why not to. 
but so many people (whose code seems fine, even great) use Self all the 
time for a dummy Sender value. is nil "old school"? what am i missing?

thx,
Dan

PS all the best in the new year!
__________________________________________________
Delphi-Talk mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi-talk

Reply via email to