> For the complete documentation index, see [llms.txt](https://chaoses-ib.gitbook.io/directory-opus/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://chaoses-ib.gitbook.io/directory-opus/manual/reference/scripting_reference/scripting_objects/var.md).

# Var

The **Var** object represents an individual user or script-defined variable. Individual **Var** objects can be accessed or enumerated from the [**Vars**](/directory-opus/manual/reference/scripting_reference/scripting_objects/vars.md) 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="/directory-opus/manual/reference/scripting_reference/scripting_objects/vars.md"><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="/directory-opus/manual/reference/scripting_reference/scripting_objects/vector.md"><strong>Vector</strong></a> of those types.</p>                                                                         |

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