Jump to content
Tom Wellige

3.1 - Usage - Create a persistent variable

Recommended Posts

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.

 

Include persistent variable functionality to your script:

 

image.png

 

image.png

 

 

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: Use SQL Server on different machine, Use database with different name, 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 Welcome
Set Welcome  = new PersistentVariable
Welcome.Name = "Welcome"

 

In line 1 you define a new VBScript variable.

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.
 

 

Index

<< Previous 2.3 - Setup Persistent Variable GSE Action

>> Next 3.2 - Usage - Store a value


 

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.