> For the complete documentation index, see [llms.txt](https://docs.budgielang.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.budgielang.org/syntax/enums.md).

# Enums

An "enum" is a container for a specific set of constant names that should be referenced by variables. Languages vary in their understanding of how to represent these fixed values, but all can achieve some equivalent.

Start an enum with `enum start`, which takes in a PascalCase name of an enum. Ed an enum with `enum end`.

Each enum value is declared with `enum member`, which takes in a PascalCase name of a member value, an integer value, and if not the last in the enum, a `,` comma.

```
enum start : Direction
    enum member : Unknown 0 ,
    enum member : Horizontal 1 ,
    enum member : Vertical 2
enum end
```

In C#:

```csharp
enum Direction
{
    Unknown = 0,
    Horizontal = 1,
    Vertical = 2
}
```

In Python:

```python
class Direction(Enum):
    Unknown = 0
    Horizontal = 1
    Vertical = 2
```

Enum types can be treated as their own type in type declarations. Later on, you can reference these enum values using the `enum` command, which takes in a name of an enum and a name of one of its values.

```
variable : direction Direction { enum : Direction Horizontal }
```

* In C#: `Direction direction = Direction.Horizontal;`
* In Python: `direction = Direction.Horizontal`

## Exports

You can export enums from the current file by including the `export` keyword before the enum's name.

```
enum start : export Direction
    enum member : Unknown 0 ,
    enum member : Horizontal 1 ,
    enum member : Vertical 2
enum end
```

In C#:

```csharp
public enum Direction
{
    Unknown = 0,
    Horizontal = 1,
    Vertical = 2
}
```

In Python:

```python
class Direction(Enum):
    Unknown = 0
    Horizontal = 1
    Vertical = 2
```

## Notes

Enums are fairly non-standard across languages. Don't assume member values to be anything more than a visual suggestion:

* Some languages such as C# will sometimes later treat the values as string-likes, such as in string contatenation.
* Some languages such as Java will skip printing them altogether.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.budgielang.org/syntax/enums.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
