|
Re: Is there a way to find every variable in current session where the variable name contains a specific string? [message #78317 is a reply to message #78316] |
Fri, 11 November 2011 08:21  |
Heinz Stege
Messages: 189 Registered: January 2003
|
Senior Member |
|
|
On Fri, 11 Nov 2011 02:39:18 -0800 (PST), Rob wrote:
> I wondered if the above was possible in IDL 7. I have 2 datasets which
> have a lot of variables associated with them and all the variables are
> prefixed with for example dataset1_something and dataset2_something.
>
> I know what all the "somethings" are so using EXECUTE to construct the
> variable name from a string I can loop over all of these variables and
> operate on them but it would be nicer if there was some way to
> identify them without needing to know their names beforehand.
You can get a string array with the names of all variables with
array=scope_varname()
If you want to know the names of the variables within an IDL savefile
before restoring it, look for
IDL_Savefile::Names
Heinz
|
|
|