Open System Testing Architecture

TOC PREV NEXT INDEX



Variable Scope Options

The variable scope options define how widely accessible the variable is; they are mutually exclusive. The variable scope options are:

 ,LOCAL
 ,SCRIPT
 ,THREAD
 ,GLOBAL

These options 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 if no scope option 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 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.

See also:

Variable Options


OpenSTA.org
Mailing Lists
Further enquiries
Documentation feedback
CYRANO.com
TOC PREV NEXT INDEX