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 #18588] Wed, 19 January 2000 00:00 Go to previous message
Michael Lefsky is currently offline  Michael Lefsky
Messages: 9
Registered: October 1999
Junior Member
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Craig Markwardt wrote:
<p>>Incidentally, there is an internal IDL routine which *can* do this.
<br>>Unfortunately you need to write a DLM to access it.
<p>I&nbsp;haven't worked with the internal IDL&nbsp;routines, and don't
plan to. But I did look at the EDG documentation,
<br>and it seems like it would be relatively straighforward to write a
toolbox&nbsp; that would allow us (the IDL&nbsp;user community)&nbsp;to
access main level variables from within procedures. For instance, an IDL
shell could
<br>be written to access the routine
<p> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
IDL_VPTR IDL_GetVarAddr(char *name)
<p>which would return the address of the variable, and then the variable
could be obtained and returned as the return value of the function.
<p>Has anyone written such a toolbox?
<br>&nbsp;
<p>Craig Markwardt wrote:
<blockquote TYPE=CITE>Michael Lefsky &lt;lefsky@home.com> writes:
<p>> 2) Is it possible to access main level variables from within a procedure?
<br>> For instance, to solve the problem outlined in 1), you could simply
<br>> write a procedure called "save" which would have precedence over
the
<br>> system command save. However, once in the procedure "save", you would
no
<br>> longer have access to the main level variables that you want to save.
<br>> Even if you specified them as arguments to "save" you would no longer
<br>> have access to their original (ie. main level) names. There are numerous
<br>> applications for which I would like to be able to somehow get either
)
<br>> the names of the variables passed to the current procedure (ie. the
<br>> names they had at the level above them) or to access the main level
<br>> variables. Of course there might be numerous ways to do either of
these
<br>> things, from the ugly to the sublime- personally, I am not particular.
<p>I like your questino.&nbsp; I know I will get flamed for saying it,
but I
<br>think there are some times when it is desireable for a program to
<br>deposit its results into the main level.&nbsp; For example, a fully
canned
<br>curve fitting program may want to return the fitting results.&nbsp;
This
<br>should of course be done with full control and permission of the user.
<p>"Why," you ask, "don't you just return it as a regular or keyword
<br>parameter?"
<p>"Simple," I say.&nbsp; "You don't always know how many variables you
are
<br>going to return."&nbsp; Also, if it were a curve fitting program "for
<br>dummies" then I would want to make it as simple as possible.
<p>Incidentally, there is an internal IDL routine which *can* do this.
<br>Unfortunately you need to write a DLM to access it.
<p>Craig
<p>--
<br> ------------------------------------------------------------ --------------
<br>Craig B. Markwardt, Ph.D.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;
EMAIL:&nbsp;&nbsp;&nbsp; craigmnet@cow.physics.wisc.edu
<br>Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
<br> ------------------------------------------------------------ -------------- </blockquote>

<pre>--&nbsp;
Michael Lefsky, PhD
Research Ecologist
U.S. Forest Service
Forest Sciences Laboratory
Corvallis, OR&nbsp;
lefsky@fsl.orst.edu
<A HREF="http://www.fsl.orst.edu/~lefsky">http://www.fsl.orst.edu/~lefsky</A></pre>
&nbsp;</html>
[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: Fri Oct 10 12:25:25 PDT 2025

Total time taken to generate the page: 0.88328 seconds