Download META SCRIPTS Table of Contents

Transcript
Meta Scripts
Rev. 3
Name
Value
Description
Program returns1.
10.8 Global and Local Variables
You may define variables to be Local or Global. The table below summarizes the differences in
functionality between these two types of variable.
Table 6: Global and Local Variables
Global or
Local
GLOBAL
Comments
Definition Global Variables are available to all applications in the currently
running operational program.
The GLOBAL statement defines them. E.g.
Example GLOBAL myApplicationStatus;
Usage Avoid using the global statement wherever possible. It is just possible
that someone else could choose the same Global name that you have
chosen resulting in confusion and interaction with their program. Use
GLOBAL variables only for variables which must be accessed across
all windows and meta script programs.
Optional To be backward compatible with previous versions that did not support
start-up LOCAL and GLOBAL variables, you may start off the operational
program using the -defaultGlobal argument. This will treat all
variables as GLOBAL unless explicitly defined as LOCAL.
LOCAL
(Using the
LOCAL
Definition Local variables are available to the current window and any children
of that window. I.e. the variable will be available to DISPLAY
AREAS, meta scripts called from a window etc.
command)
LOCAL phase1;
Example
Wherever possible use local variables. Note that if the LOCAL
Usage command is encountered, the system will not look in the parent for the
same variable.
Variables are LOCAL if:
UM-ENG-3.1.0
i.
They are defined LOCAL using the LOCAL declaration.
ii.
They have no declaration in the meta script but the search up the
parent tree encounters a LOCAL declaration.
iii.
They encounter no GLOBAL or LOCAL declarations at all up
10-18