Stenway Developer Network

enum Keyword

Define an enumeration

A simple enumeration:

namespace MyLib
  enum Fruit
    Apple
    Banana
    Orange
  end
end

Is the same as:

namespace MyLib
  enum Fruit
    Apple = 0
    Banana = 1
    Orange = 2
  end
end

String values:

namespace MyLib
  enum Fruit
    Apple = "AP"
    Banana = "BA"
    Orange = "OR"
  end
end