Dodo doc > Variables and Functions > Constants and Enums > Enum Variables


Enum variables

Variables and constants of type "enum" contain enum values. Their syntax is otherwise identical to normal variables.

Add ".value" when trying to access the value stored in an enum variable or constant otherwise the compiler would think its name is an enum value.

Examples:

enum _période = _après-midi
.align = _LEFT_ALIGNMENT
def colour -> get(enum) = blue
results[month.value]
Rationale: since variable names have the same syntax as enum values there could be a confusion as to which of the two choices should be used. But variables can have attributes while enum values cannot, so adding the value attribute removes that ambiguity.

^ 3.2.1. Constants

v 3.3. Linked References