C++ Replacement or similar keywords for 'is' and 'as' Delphi keys.

hello there,
i am a newcomer to C++ Builder so excuse any mistake.
My question is (maybe a stupid question)
My first language is Delphi and i usually use this type of sentences:
if Sender is TEdit then (Sender as TEdit).Text := '';
A replacement or similar keywords exist for C++ Builder?
Thanks in advance.
0
finneas
9/27/2010 11:37:55 AM
📁 embarcadero.cppbuilder.cpp
📃 2803 articles.
⭐ 0 followers.

💬 4 Replies
👁️‍🗨️ 1055 Views


Am 27.09.2010 13:37, schrieb finneas finn:
> A replacement or similar keywords exist for C++ Builder?
TEdit * Edit;
if ((Edit = dynamic_cast<TEdit*>(Sender)) != 0)
{
        Edit->Text = "";
}
Christian
0
Christian
9/27/2010 11:42:29 AM
Il Mon, 27 Sep 2010 04:37:55 -0700, finneas finn <> ha scritto:
>hello there,
>
>i am a newcomer to C++ Builder so excuse any mistake.
>
>My question is (maybe a stupid question)
>
>My first language is Delphi and i usually use this type of sentences:
>
>if Sender is TEdit then (Sender as TEdit).Text := '';
>
>A replacement or similar keywords exist for C++ Builder?
>
>Thanks in advance.

if ( TEdit* const Edit = dynamic_cast<TEdit*>( Sender ) )
    Edit->Text = "";
Regards.
Giuliano
0
Giuliano
9/27/2010 12:38:58 PM
> {quote:title=Christian Gudrian wrote:}{quote}
> Am 27.09.2010 13:37, schrieb finneas finn:
> 
> > A replacement or similar keywords exist for C++ Builder?
> 
> TEdit * Edit;
> if ((Edit = dynamic_cast<TEdit*>(Sender)) != 0)
> {
>    Edit->Text = "";
> }
> 
> Christian
Thanks Christian for your quick answer.
0
finneas
9/27/2010 1:48:45 PM
> {quote:title=Giuliano . wrote:}{quote}
> Il Mon, 27 Sep 2010 04:37:55 -0700, finneas finn <> ha scritto:
> 
> >hello there,
> >
> >i am a newcomer to C++ Builder so excuse any mistake.
> >
> >My question is (maybe a stupid question)
> >
> >My first language is Delphi and i usually use this type of sentences:
> >
> >if Sender is TEdit then (Sender as TEdit).Text := '';
> >
> >A replacement or similar keywords exist for C++ Builder?
> >
> >Thanks in advance.
> 
> 
> if ( TEdit* const Edit = dynamic_cast<TEdit*>( Sender ) )
>     Edit->Text = "";
> 
> Regards.
> 
> Giuliano
and Thanks Giuliano too.
0
finneas
9/27/2010 1:51:11 PM
Reply: