Delphi Programming Tutorial #57 - ScopedEnums
Loading...
836
views
Loading...
Uploader Comments (codegearguru)
see all
All Comments (3)
-
lame video. please post something more interesting.
Loading...
2nd half of the demo was a bit suspect imho - you are highly unlikely to save the ord() of an enum member directly. Even if you aren't saving the enum member *name* (which you should be doing, of course) you are in any event far more likely to save the Ord() of a variable of a specific enum type, and cast back to that same type when loading from storage. Since variables are typed, the scoping issue of one "foot" obscuring another is highly unlikely to occur in the way shown.
delticsnz 11 months ago
@delticsnz I think the point is more that things can go wrong in unusual ways, not that my contrived example is representative of how one should write code in the large. But yes I agree, in most instances Delphi typing will prevent such errors.
codegearguru 11 months ago