Enum Names |
Smart pascal source code
type TEnum = (enOne, enTwo, enThree); type TDisj = (d0 = 0, d2 = 2, d4 = 4, d6 = 6, d8 = 8, d10 = 10, d12 = 12); { main.pas } var j: integer; Begin WriteLn(TEnum.enOne.Name); WriteLn(enTwo.Name); WriteLn(TEnum(Ord(enTwo) + 1).Name); for var e in TEnum do WriteLn(e.Name); for j := 0 to 12 step 3 do begin var e: TDisj; e := TDisj(j); WriteLn(e.Name); end; { <<< CONSOLE OUTPUTS >>> enOne enTwo enThree enOne enTwo enThree d0 ? d6 ? d12 }