2
votes
Vote UpVote

TObject(Sender) vs. (Sender as TObject) - Differences Between a Hard Cast and an AS Cast in Delphi

About Delphi Programming – in Delphi TIPS :: In Delphi the AS keyword is used for casting an object (or interface) of one type to another. When several controls share an event handling procedure, for example a button and a menu item, you end up using the Sender parameter to identify the control that actually caused the event to be raised. When casting the Sender you can either use the hard-cast, for example, TButton(Sender) or the as-cast (Sender as TButton). Read the full article to learn about TObject(Sender) vs. (Sender as TObject) - Differences Between a Hard Cast and an AS Cast in Delphi. Related: Delphi's RTTI ...
Favorite? Off-Topic? 2010-01-15 06:00

Statistics

Visits: 643
Votes: 2
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

AlinS
The Delphi Disciple
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)