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

Home » Public Forums » archive » Re: Renaming a variable in IDL?
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: Renaming a variable in IDL? [message #55504 is a reply to message #55503] Fri, 24 August 2007 01:38 Go to previous messageGo to previous message
Foldy Lajos is currently offline  Foldy Lajos
Messages: 268
Registered: October 2001
Senior Member
On Fri, 24 Aug 2007, peterberg79@gmail.com wrote:

> Hi,
> I am writing a procedure for autmatically saving some variables from
> more advanced programs for easy access later on. Something along the
> lines of:
>
> PRO, SAVPRO, XVAR, Fname
> save, XVAR, filename=Fname
> end
>
> So if I want to save the file 'YVAR' to filename 'YVAR.sav' I would
> call:
> SAVPRO, YVAR, 'YVAR.sav'
> The problem is that in the save file the variable would be called XVAR
> instead of YVAR, which is a problem for me.
> I realized that I can retrieve the original varaible name as a string
> and include it to the SAVPRO call. But then I got lost on how to
> rename a variable to a string name. I was thinking there might be
> soemthing along the lines of using echo in unix (echo
> $STRYVAR'=XVAR'), but I have found no such function.
>
> My question is: Is it possible to rename a variable in IDL
> automatically? Or is there a better way to do all this?
>
>

1. execute

2. (scope_varfetch('xvar', /enter))=temporary(yvar) moves the content of
yvar to xvar (yvar will be undefined).

regards,
lajos
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: read_ascii for more than one file
Next Topic: CHECKBOX default in ION

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

Current Time: Sat Oct 11 08:58:24 PDT 2025

Total time taken to generate the page: 0.56050 seconds