Jump to content

- Scopes

- # Persistent Variables - 5.2 - SCOPE_USER

  Followers 0

  VBScript

  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 with a scope seto to SCOPE_USER 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 for a user. If the variable is used in a call routing for a group the default is SCOPE_GROUP. If being used outside of a call routing script (new in v1.1.0) the default is SCOPE_GLOBAL.

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

  If you use the persistent variable in a user call routing, the default scope is SCOPE_USER, so you an shorten your code to:

      Dim Announcement
      Set Announcement  = new PersistentVariable
      Announcement.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.

  By Tom Wellige

  - May 14, 2022
  Share
  Share
  Followers 0
  Previous Page 5.1 - SCOPE_NAMESPACE
  Next Page 5.3 - SCOPE_GROUP

## 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.