[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Discussion on global variables in IDL

alt@iszf.irk.ru (Altyntsev Dmitriy) writes:

> Hello, 
> 	I'd like to discuss global variable management in IDL. I've read a
> pair of NG threads on that theme, and would like to add some
> consideration and share experience. Some time ago I've sent a letter
> to RSI with some proposals, but since then two version have been
> released and I don't see any movement in the direction of improving
> global vars management. It seems that everyone is satisfied. Is it
> really so?

  Well, I don't think the situation is as bad as you paint it. First of all
I recommend objects - which are in fact "global" (as long as you don't loose
the object reference), secondly widgets (which provide you with a UValue
field and thu sgive you an opportunity to assess the underlying widget object
reference as long as you see it on the screen ;-) [but, seriously: don't
tell David that you have seriously even thought about using a COMMON block
in a widget program; he will slam you with a box of his books]. Finally,
you have user variables (the ! thingies). So, if you like, you can make 
up your own global variable system by defining a system variable !GLOBAL
which contains a pointer pointing to a pointer (or object reference) array;
plus, you will need some "management" information. Come to think of it; 
the behaviour you would like to see there, is exactly what a container 
object is designed for. And if you use my version (instead of IDL_Container),
you can even search your variables by name.



[[ Dr. Martin Schultz   Max-Planck-Institut fuer Meteorologie    [[
[[                      Bundesstr. 55, 20146 Hamburg             [[
[[                      phone: +49 40 41173-308                  [[
[[                      fax:   +49 40 41173-298                  [[
[[ martin.schultz@dkrz.de                                        [[