# Var

The **Var** object represents an individual user or script-defined variable. Individual **Var** objects can be accessed or enumerated from the [**Vars**](https://chaoses-ib.gitbook.io/directory-opus/manual/reference/scripting_reference/scripting_objects/vars) object.

| Property Name      | Return Type                                   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ------------------ | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| *\<default value>* | <p><em>variant</em><br>or <em>string</em></p> | <p>The default value of the <strong>Var</strong> object returns the value of the variable itself, with one exception. If the <strong>Var</strong> object is being accessed as part of an enumeration of the <a href="vars"><strong>Vars</strong></a> collection, the default value returns the variable name.</p><p>So for instance,</p><p>For Each Var in DOpus.Vars<br>DOpus.Output("Variable name = " & Var)<br>Next</p><p>Versus:</p><p>Set Var = DOpus.Vars("myvar")<br>DOpus.Output("Variable value = " & Var)</p> |
| name               | *string*                                      | Returns the name of the variable. You cannot change the name of a variable once it has been assigned - instead, delete the variable from its collection and add a new one.                                                                                                                                                                                                                                                                                                                                               |
| persist            | *bool*                                        | Returns **True** if the variable is persistent (saved) or **False** if not. You can set this property to change the persistence state.                                                                                                                                                                                                                                                                                                                                                                                   |
| value              | *variant*                                     | <p>Returns the value of the variable. You can set this property to change the value of the variable.</p><p>You can store any type of variable in a <strong>Var</strong> object, although not all types can be saved to disk. If you want your variable to be persistent you should only use <em>bool</em>, <em>int</em>, <em>string</em>, <em>date</em>, <em>currency</em> or a <a href="vector"><strong>Vector</strong></a> of those types.</p>                                                                         |

| Method Name | **Arguments** | Return Type | Description                                       |
| ----------- | ------------- | ----------- | ------------------------------------------------- |
| Delete      | *none*        | *none*      | Deletes this variable from its parent collection. |


---

# 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://chaoses-ib.gitbook.io/directory-opus/manual/reference/scripting_reference/scripting_objects/var.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.
