2
votes
Vote UpVote

Functional programming style in Delphi

The Programming Works – Functional programming paradigm gradually finds its way even in Delphi – a procedural language without a garbage collector. Consider the next code sample that changes a button’s caption using extended RTTI (requires Delphi 2010 and above): procedure TForm1.Button1Click(Sender: TObject); var Ctx: TRttiContext; P: TRttiProperty; T: TRttiType; begin T:= Ctx.GetType(TButton); P:= T.GetProperty('Caption'); P.SetValue(Button1, 'RTTI'); end; When analyzing the above code snippet note the following: TRttiContext is a record type; you need not create and destroy a variable ...
Favorite? Off-Topic? Serg @ 2012-02-04 03:57

Statistics

Visits: 1165
Votes: 2
Favorites: 1
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Alister Christie
vibeeshanRC
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)