comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » global variables and IDLSPEC issues
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Global variables and IDL [message #15162 is a reply to message #11537] Fri, 23 April 1999 00:00 Go to previous messageGo to previous message
L. Paul Mix is currently offline  L. Paul Mix
Messages: 8
Registered: July 1996
Junior Member
David Foster wrote:

> <Deleted >
>
> I applaud your courage Martin! My name is David Foster, and I have
> been a common-block user...
>
> I think the idea of global variables would be very powerful, and the
> ability to have global pointers would be extremely useful in our
> applications. We have a series of programs that are run consecutively,
> on the same LARGE data-sets, and we use common blocks to store these
> data sets. We find this approach much faster than other possibly
> "cleaner" programming approaches, and for our purposes we would never
> want to have more than one instance of one of these programs running.
> If we did, we could certainly structure the common variables to
> accomodate this!
>
> If global variables were to be introduced into IDL, I would hope
> that we would also get some mechanism for limiting the visibility
> of these variables, some way to say "use this global variable" within
> a routine. Something similar to the EXTERN construct in C.
>
> Coming from a C background, my first impression of IDL was that it
> provides *very* limited control over scope and visibility of variables
> and function/procedure names.
>
> Dave
> --
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
> David S. Foster Univ. of California, San Diego
> Programmer/Analyst Brain Image Analysis Laboratory
> foster@bial1.ucsd.edu Department of Psychiatry
> (619) 622-5892 8950 Via La Jolla Drive, Suite 2240
> La Jolla, CA 92037
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~

As a long time IDL programmer I also admit to using common blocks for global variables.

Common blocks for widget programs are generally a bad idea, but, for variables with
truly
universal scope in an application, common blocks allow the variable the necessary scope

while hiding them from the user.

RSI developed pointer variables as a replacement for handles but they suffer from the
problem
that a user can be completely overwhelmed if he types: help, /heap and an application
has used
several hundred pointers.

My background is Fortran not C, but I totally agree with Dave that the ablility to
limit the scope
and visibility of a variable should not be overlooked in the quest for global
variables.

Paul
============================================================ ==================
L. Paul Mix
Distinguished Member of the Technical Staff
Electromagnetics and Plasma Physics Analysis

Sandia National Laboratories
MS 1186, P.O. Box 5800
Albuquerque, NM 87185-1186
E-mail: lpmix@sandia.gov
Phone: (505) 845-7493
FAX: (505) 845-7890
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Reading DXF?
Next Topic: Help for Wav

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 07:06:44 PDT 2025

Total time taken to generate the page: 1.03966 seconds