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

Home » Public Forums » archive » Re: converting a string to an IDL command
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: converting a string to an IDL command [message #62380 is a reply to message #62377] Mon, 08 September 2008 12:29 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Mark writes:

> Actually, I have a related question, for which if it's obvious I
> apologize in advance.
>
> Not sure how to put this precisely, but....
>
> Let's say I have an array called "happydays".
>
> I'd like to make a function that would take the string 'happydays',
> and say, return the min and max of the array with that name:
>
> out=some_function('happydays')
> where out is the string:
>
> 'The max and min of HAPPYDAYS is 0 and 15"
>
>
> Just as well, would be something like:
>
> out=some_function(happydays)
> and out is the same string as above.
>
> In other words, I guess what I'm asking is, is there a way to find
> the original name of a variable that was passed to a sub-program or a
> function....

Now you are going down a really slippery slope. Better be
careful!

Think about it. You are inside of SOME_FUNCTION and you need
to know something about a variable array named "happydays".
Where is this array? Not inside the function where you are
thinking about it, that's for sure. Could you find it anyway?

Maybe, if you knew where to look. But where would that be?
One level up? Unlikely. Because if it were there, the person
who called you could have just as easily called the MINMAX command on
the array itself. Why didn't he? Maybe he didn't know where it was
either. Are you going to look for the data array everywhere? Where
*is* everywhere, anyway?

Anyway, if you think this is worth pursuing (I don't), then have
a look at the SCOPE_VAR** routines. They are what you want to use to
nose around in places you have no business being.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[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
Previous Topic: Re: map plotting
Next Topic: Re: inverse the axis

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

Current Time: Fri Oct 10 13:38:01 PDT 2025

Total time taken to generate the page: 2.88262 seconds