# add\_enum

```
add a new enum type
     idx - serial number of the new enum.
           If another enum with the same serial number
           exists, then all enums with serial
           numbers >= the specified idx get their
           serial numbers incremented (in other words,
           the new enum is put in the middle of the list
           of enums).
           If idx >= get_enum_qty() or idx == -1
           then the new enum is created at the end of
           the list of enums.
     name - name of the enum.
     flag - flags for representation of numeric constants
            in the definition of enum.
returns: id of new enum or -1.

long add_enum(long idx, string name, long flag);
```


---

# Agent Instructions: 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:

```
GET https://docs.hex-rays.com/8.4/developer-guide/idc/idc-api-reference/alphabetical-list-of-idc-functions/731.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
