Vote UpVote

Delphi Tech Tip 01: TCast.GetAs

Marco's Tech Blog – This is a very technical Delphi tip, possibly the first of a series... or maybe not. Over the 5 years I've had this blog, I rarely covered purely technical tips, but it might change (particularly if you tell me you like it). As if not nil The problems at hand is how to perform an "as" cast (a cast to a derived class) but only if the reference is not nil. in fact if you write, obj as TButton it will raise an exception in case the obj is not a TButton, but also in case obj is not assigned. Now if you write: if obj is TButton then you'll equally get the exception in case ...
Favorite? Off-Topic? marcocantu @ 2011-05-05 13:10


Visits: 950
Votes: 1
Favorites: 1
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Jeroen Pluimers
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News


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