2
votes
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 ...
Statistics
|
Visits by Source |
User Actions |



