Environment
Situation
Question
What is the local run-time variable command used for?
Answer
Run-time variables are declared in the format ?VariableName. Run-time variables can be declared as being local. Instead of being stored in the SLBroker like normal run-time variables, they are stored in the script parser. This means local variables only exist for the lifetime/instance of the script that they are running. Normal run-time variables, in contrast, exist for the lifetime of SLBroker.Exe (i.e. as long as SecureLogin is running on the workstation).
Local run-time variables are used in exactly the same way as normal run-time variables and are still written as ?VariableName. They are declared local using the command ""Local"" followed by the variable name. Once they have been declared local, they can not be set back again. You may declare a run-time variable local at any time in a script. When the script hits a ""Local"" command, it will read that variable’s value from the SLBroker as per normal.
It will then copy that value and place the variable in the list of local run-time variables. Whenever a run-time variable is referenced, it will search through the list of local variables, and only if the variable does not exist in that list will it query SLBroker for the variable.
Declare a variable local in the following way:
Local ?RunCount
Using local run-time variables will also slightly improve the performance of SecureLogin. However, the main reason for using them is if you want to be able to run scripts multiple times and not have the run-time variables stored between instances, or if you want to have two instances of a script running at the same time and do not want the run-time variables overwriting each other.
"Resolution
Answer
Run-time variables are declared in the format ?VariableName. As of version 3.x, run-time variables can be declared as being local. Instead of being stored in the SLBroker like normal run-time variables, they are stored in the script parser. This means local variables only exist for the lifetime/instance of the script that they are running. Normal run-time variables, in contrast, exist for the lifetime of SLBroker.Exe (i.e. as long as SecureLogin is running on the workstation).
Local run-time variables are used in exactly the same way as normal run-time variables and are still written as ?VariableName. They are declared local using the command ""Local"" followed by the variable name. Once they have been declared local, they can not be set back again. You may declare a run-time variable local at any time in a script. When the script hits a ""Local"" command, it will read that variable’s value from the SLBroker as per normal.
It will then copy that value and place the variable in the list of local run-time variables. Whenever a run-time variable is referenced, it will search through the list of local variables, and only if the variable does not exist in that list will it query SLBroker for the variable.
Declare a variable local in the following way:
Local ?RunCount
Using local run-time variables will also slightly improve the performance of SecureLogin. However, the main reason for using them is if you want to be able to run scripts multiple times and not have the run-time variables stored between instances, or if you want to have two instances of a script running at the same time and do not want the run-time variables overwriting each other.