1) Does anyone know if it is possible to loop through an irregular enumeration in Delphi (XE)?
Looping over a normal enumeration is ok. From Delphi Basics:
I do not have a Delphi compiler at hand right now, but I tink that gabr's approach can be rather significantly improved by doing
type TSuit = (Hearts = 1, Clubs, Diamonds = 10, Spades); const Suits: array[0..3] of TSuit = (Hearts, Clubs, Diamonds, Spades);
Who knows, maybe it doesn't even compile.