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

Home » Public Forums » archive » Variable name to string
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: Variable name to string [message #25858 is a reply to message #25780] Wed, 18 July 2001 12:32 Go to previous messageGo to previous message
Chad Bender is currently offline  Chad Bender
Messages: 21
Registered: July 2001
Junior Member
Thanks Craig. That is just what I was looking for. Running the program
at the main level is not a problem for me. Basically, I have a bunch of
data stored in array's and saved in an IDL save file. I just needed
something to convienently get them out of IDL and into individual text
files, while retaining the information contained in the array names.

Chad

On 18 Jul 2001, Craig Markwardt wrote:

>
> Chad Bender <cbender@mail.astro.sunysb.edu> writes:
>
>> Hello-
>>
>> Can anyone please point me towards the solution of the following
>> problem?

>
> This appears to be basic string manipulation, which can be
> accomplished using the "+" symbol.
>
> ;; Get variable name.
> varname = ''
> read, varname
>
> ;; Derive file name from variable name
> filename = varname + '.dat'
>
> Now, as the others have pointed out, the harder question is really,
> how do you get at a variable for which you only have the name?
> EXECUTE can work if the variable and your code are at the same level.
> For example, this code
>
> return_code = execute('DATA = '+varname)
>
> will put the data into a variable named DATA. Also, sneaky use of
> ROUTINE_NAMES can do it. But honestly, you should try to re-work your
> concept so you don't have to do that if you can.
>
> 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
Previous Topic: Re: help with findfile
Next Topic: Re: Plotting a 3D Array In IDL

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

Current Time: Fri Oct 10 02:47:29 PDT 2025

Total time taken to generate the page: 0.72233 seconds