Jump to content
Tom Wellige

3.3 - Usage - Retrieve a value

Recommended Posts

Retrieving a persistent variable like storing it very straight forward, just like common VBScript variables.


The only difference is, that the value you read from the variable will be taken from the database in that moment.

Dim Welcome
Set Welcome     = new PersistentVariable
Welcome.Name    = "Welcome"
Welcome.Default = "Beep.wav"
PlaySound Welcome.Value


Before you read the content from the persistent variable you should define a Default value. This value will be returned in case nothing has been stored previously into the persistent variable.


Reading content from a persistent variable is the same as you would use a common variable, just that you have to read the Value property.


The above code passes the content of the persistent variable as parameter into the PlaySound function.


You can also access the variable directly in nearly any of the GSE blocks:



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.


You will find the Simple Script - Retrieve Variable in the download package which includes the above code (except line 6).



<< Previous 3.2 - Usage - Store a value

>> Next 3.4 - Usage - Simple Script - Store Variable


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.