OpenSTA logo OpenSTA SCL Reference
Variable Scope Options

Variable Scope Options

The variable scope options define how widely accessible the variable is; a variable may only have one scope value, these values are mutually exclusive. The variable scope option values are:

,LOCAL
,SCRIPT
,THREAD
,GLOBAL

These option values are described below:

LOCAL

Local variables are only accessible to the thread running the Script in which they are defined. They cannot be accessed by any other threads or Scripts (including Scripts referenced by the main Script). Similarly, a Script cannot access any of the local variables defined within any of the Scripts it calls.

Space for local variables defined within a Script is allocated when the Script is activated and deallocated when Script execution completes.

This is the default scope if no scope option value is specified in the variable definition.

SCRIPT

Script variables are accessible to any thread running the Script in which they are defined.

Space for the Script variables defined within a Script is allocated when the Script is activated and there are no threads currently running the Script. If one or more threads are already running the Script, the existing Script variable data is used.

The space for Script variables is normally deallocated when the execution of a Script terminates, and no other threads are running the Script. In some cases, however, it may be desirable to retain the contents of Script variables even if there is no thread accessing the Script. This can be achieved by using the ,KEEPALIVE clause on the EXIT command. The space allocated to Script variables is only deleted when a thread is both the last thread accessing the Script and has not specified the ,KEEPALIVE clause. A particular use of this clause is where the Script is being called by a number of threads, but there is no guarantee that there will be at least one thread accessing the Script at all times.

THREAD

Thread variables are accessible from any Script executed by the thread (Virtual User) which declares an instance of them.

The space for thread variables is deallocated when the thread completes.

Thread variables cannot have associated value lists or ranges.

GLOBAL

Global variables are accessible to any thread running any Script under the same Test Manager.

The space for global variables is deallocated when the Test Manager in question is closed down.

Global variables cannot have associated value lists or ranges.


<<<
prev page
^^^
section start
>>>
next page