Board index » cppbuilder » Parametervalue for TObject *Sender?

Parametervalue for TObject *Sender?

I want to reuse some code in several methods by just calling the first
method: Button1Click(TObject *Sender)
in a case like this, what do I write as parametervalue when calling
this method?
Sincerely
Anders Winthereik
 

Re:Parametervalue for TObject *Sender?


If your other methods are event handlers you will have a Sender for them
so just use that. If not, you can pass 0 for the Sender.
Quote
Anders Winthereik wrote:
> I want to reuse some code in several methods by just calling the first
> method: Button1Click(TObject *Sender)
> in a case like this, what do I write as parametervalue when calling
> this method?
> Sincerely
> Anders Winthereik

Re:Parametervalue for TObject *Sender?


: winther...@yahoo.com (Anders Winthereik) wrote:

Quote
>I want to reuse some code in several methods by just calling the first
>method: Button1Click(TObject *Sender)
>in a case like this, what do I write as parametervalue when calling
>this method?

NULL, perhaps? Anything, basically, if it is compatible with your use of
the Sender parameter in the event.

Anders, I do not see the relationship of this question to the IDE, but I
may be missing something?

--
Stefan Hoffmeister (TeamB)     http://www.econos.de/
Please do apply judgement when sending email.

Other Threads