Jump to content

- Usage

- # Persistent Variables - 3.1 - Create a persistent variable

  Followers 0

  VBScript

  To be able to use persistent variables you need to add one Run GSE Action block into your script, calling the PersistentVariable action. It is recommended to place this block right after the Start block.

  If you have installed the Persistent Variables extension as recommended you don't need to set any of the properties of the GSE action. Otherwise you should refer to:6.3 - Use SQL Server on different machine, 6.4 - Use database with different name, 6.5 - Use different database.

  Using persistent variables does not much differ from using common VBScript variables. If you want to use own VBScript variables you do this anywhere in your VBScript code. This can either be in the Start block or in a common Insert Script Code block.

  Note: if you want to use a persistent variable within some VBScript functions you have defined in the Start block as also in the graphical part of the script, lets say in the Play Accouncement block you need to define it in the Start block.

  The Set Variable block can't be used for persistent variables (as it generates common VBScript variables).

  Afterwards you create persistent variables as following:

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

  In line 1 you define a new VBScript variable "Announcement".

  In line 2 you set this variable as of type "PersistentVariable".

  In line 3 you give the persistent variable a unique Name. This name identifies the variable and it is stored with this name in the database.

  With nothing else configured the above persistent variable will be visible/accessible for the current script user only (the User scope is the default scope). To configure another scope (Global or Namespace) you have to change the Scope property.

  Once the persistent variable is created you can use it as every other variable. In the moment you put something in it, it will be automatically stored into the database. In the moment where you want to get something out of it, it will be taken from the database.

  See the following pages for examples.

  By Tom Wellige

  - May 14, 2022
  Share
  Share
  Followers 0
  Next Page 3.2 - Store a value

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