8
votes
Vote UpVote

Property expressions and statements

DelphiTools – Object Pascal does allow binding a property to a field for direct read/writer, but we all have seen properties that required a slightly more complex getter or setter, and that usually meant a method for both. DWScript (svn trunk) & Smart Pascal (1.1) now support property expressions and statements, so the syntax is extended to allow: property Name : Type read (expression) write (expression|statement) Under the hood, the compiler will generate an unnamed getter or setter method when appropriate. Let’s take f.i. a class that exposes an internal list, you can now use just TMyClass = ...
Favorite? Off-Topic? Eric @ 2013-02-14 14:24

Statistics

Visits: 628
Votes: 8
Favorites: 0
Off-Topic: 1

Visits by Source

User Actions

Users who voted for this posting

Ericc
François
Jan Derk
Jørn E. Angeltveit
Mohammed Nasman
runner
Yogi Yang
Zzzzz
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)