Renaming a variable in IDL? [message #55507] |
Fri, 24 August 2007 00:28 |
peterberg79
Messages: 2 Registered: August 2007
|
Junior Member |
|
|
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?
|
|
|