Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Enumerations are handy to use as fields and properties in classes.

Code Block
borderStylesolid
titledeclaring an enum
borderStylesolid
enum Day:
    Sunday
    Monday
    Tuesday
    Wednesday
    Thursday
    Friday
    Saturday

class Action:
    [Property(Day)]
    _day as Day

...

Enumerations technically assign an integer value to each value, but that should generally be abstracted from view.

Code Block
borderStylesolid
titledeclaring an enum
borderStylesolid
enum Test:
    Alpha
    Bravo
    Charlie

is the same as

Code Block
borderStylesolid
titledeclaring an enum
borderStylesolid
enum Test:
    Alpha = 0
    Bravo = 1
    Charlie = 2

...