Delphi Programming Tutorial #57 – ScopedEnums
In this video Alister Christie looks at the $SCOPEDENUMS compiler directive when using enumerated types.


Jolyon Direnko-Smith says:

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.

Alister Christie says:

@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.

Rick Wheeler says:

lame video. please post something more interesting.

 Write a comment


Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!