Jump to content
Gold Sponsor: Data-Way IT-Consulting, Austria

  • 3.3 - Retrieve a value

    3.3 - Retrieve a value

    VBScript

     

    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 MyVariable
    Set MyVariable     = new PersistentVariable
    MyVariable.Name    = "Welcome"
    MyVariable.Default = "Beep.wav"
     
    PlaySound MyVariable.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:

     

    pv3.png

     

    (Please note: in this screenshot the name of VBScript variable is "Welcome", while in the above code snippet it is "MyVariable". This is just because it was renamed after taking the screenshot. It has no functionaly reason.)

     

     

    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 3.5 - Simple Script - Retrieve Variable in the download package which includes the above code (except line 6).

     

     


    Tom Wellige
     Share


     Share




×
×
  • 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.