Re: Defining system variables [message #57] |
Fri, 09 August 1991 14:43  |
sterner
Messages: 106 Registered: February 1991
|
Senior Member |
|
|
fireman@stars.gsfc.nasa.gov (Gwyn Fireman) writes:
> I am attempting to create an IDL user environment that uses several
> non-standard system variables. These variables will build upon one another;
> that is, I will define one system variable, then use it to define others.
It sounds like you have a need for global variables. Another
technique that gives something like global variables is to use
a common. If you keep the common in a seperate file, maybe
something like XXX_COM.PRO, it may be included in an IDL routine
by the statement @XXX_COM (starting in column 1). This common is
then included in any routine that needs it, such as an initialization
routine that sets default values in the common. One advantage to
using commons is that you can test if a variable is defined (if
n_elements(x) eq 0 then x is undefined). One disadvantage is that
commons may not be extended while in IDL, so when you add something to
the common you have to exit and re-enter IDL. This is only a problem
during development.
Ray Sterner sterner%str.decnet@warper.jhuapl.edu
Johns Hopkins University North latitude 39.16 degrees.
Applied Physics Laboratory West longitude 76.90 degrees.
Laurel, MD 20723-6099
|
|
|