The Vars object represents a collection of user and script-defined variables. There are a number of different sets of variables, with differing scopes. Some sets support persistent variables, that are saved and re-loaded from one session to the other.
Scope |
Accessed by |
Supports Persistence |
Description |
---|---|---|---|
Global |
DOpus.vars |
Yes |
Variables that are available throughout Opus. They can be accessed by any function or script. |
Lister |
Lister.vars |
Yes |
Variables that are local to a Lister. Persistent variables are saved on a per-Lister basis in Lister Layouts. |
Tab |
Tab.vars |
Yes |
Variables that are local to a particular tab. Persistent variables are saved per-Tab in Lister Layouts. |
Script |
Script.vars |
Yes |
Variables that are local to a particular script add-in. |
Command |
Command.vars |
No |
Variables that are local to a particular function. They are not saved from one invocation of the function to another and do not support persistence. |
Property Name |
Return Type |
Description |
---|---|---|
<default value> |
collection:Var |
Returns a collection of the variables in the collection. You can enumerate the Var elements or refer to a specific one by its index or by its name. |
Method Name |
Arguments |
Return Type |
Description |
---|---|---|---|
Delete |
<string:name> |
none |
Deletes the named variable from the collection. You can also specify a wildcard pattern to delete multiple variables (or * for all). |
Exists |
<string:name> |
bool |
Returns True if the named variable exists in the collection, or False if it doesn't exist. |
Get |
<string:name> |
variant |
Returns the value of the named variable. You can use this method as an alternative to indexing the collection. |
Set |
<string:name> |
none |
Sets the named value to the specified value. You can use
this method as an alternative to indexing the collection. |