Jump to content
Tom Wellige

5.2 - Scopes - SCOPE_USER

Recommended Posts

This is a VBScript constant defined to the value of 2. This constant will be used to set the Scope of a persistent variable to the user scope.

 

Variables the user scope are visible/accessible for all scripts of the current script user.

 

This is the default scope of every new persistent variable if being used within a call routing script. If being used outside of a call routing script (new in v1.1.0) SCOPE_GLOBAL is the default scope.

Dim Welcome
Set Welcome   = new PersistentVariable
Welcome.Name  = "Welcome"
Welcome.Scope = SCOPE_USER

 

As the User scope is the default scope you can shorten your code to: 

Dim Welcome
Set Welcome   = new PersistentVariable
Welcome.Name  = "Welcome"

 

The above examples define a persistent variable Welcome in the User scope. This variable is visible/accessible for all scripts of the same user.

 

Another script of another user which defines also a persistent variable Welcome does not interfere.

 

Other available scopes:

 

 

Index

<< Previous 5.1 - Scopes - SCOPE_NAMESPACE

>> Next 5.3 - Scopes - SCOPE_GLOBAL


 

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and have taken note of our Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.