3
votes
Vote UpVote

Explicitly scoped enums

DelphiTools – Oxygene syntax (aka Delphi Prism) for enumerations was recently added to DWScript, with both enum and flags contextual keywords. Enumerations scoping was already in, but optional, using these keywords make scoping explicitly required. type    TMyEnum = enum (Alpha, Beta, Gamma); ... e := TMyEnum.Alpha; // works e := Alpha; // syntax error Since the scoping with this declaration syntax is explicit, you’re encouraged not to use prefixing for the enumeration elements, removal of the leading “T” being optional. Classic enumerations (without keyword) stay globally scoped and ...
Favorite? Off-Topic? Eric @ 2012-03-30 07:37

Statistics

Visits: 553
Votes: 3
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Ericc
Primoz Gabrijelcic
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)