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

Home » Public Forums » archive » Re: Accessing "main" level variables
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: Accessing "main" level variables [message #18607 is a reply to message #18588] Tue, 18 January 2000 00:00 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Michael Lefsky <lefsky@home.com> writes:

> 2) Is it possible to access main level variables from within a procedure?
> For instance, to solve the problem outlined in 1), you could simply
> write a procedure called "save" which would have precedence over the
> system command save. However, once in the procedure "save", you would no
> longer have access to the main level variables that you want to save.
> Even if you specified them as arguments to "save" you would no longer
> have access to their original (ie. main level) names. There are numerous
> applications for which I would like to be able to somehow get either )
> the names of the variables passed to the current procedure (ie. the
> names they had at the level above them) or to access the main level
> variables. Of course there might be numerous ways to do either of these
> things, from the ugly to the sublime- personally, I am not particular.

I like your questino. I know I will get flamed for saying it, but I
think there are some times when it is desireable for a program to
deposit its results into the main level. For example, a fully canned
curve fitting program may want to return the fitting results. This
should of course be done with full control and permission of the user.

"Why," you ask, "don't you just return it as a regular or keyword
parameter?"

"Simple," I say. "You don't always know how many variables you are
going to return." Also, if it were a curve fitting program "for
dummies" then I would want to make it as simple as possible.

Incidentally, there is an internal IDL routine which *can* do this.
Unfortunately you need to write a DLM to access it.

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: best way to ps an image
Next Topic: IDL mode in emacs and objects?

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

Current Time: Sat Oct 11 13:21:39 PDT 2025

Total time taken to generate the page: 0.08220 seconds