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

Home » Public Forums » archive » Re: Is there a way to find every variable in current session where the variable name contains a specific string?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Is there a way to find every variable in current session where the variable name contains a specific string? [message #78316] Fri, 11 November 2011 08:26
rjp23 is currently offline  rjp23
Messages: 97
Registered: June 2010
Member
On Nov 11, 4:21 pm, Heinz Stege <public.215....@arcor.de> wrote:

> 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

scope_varname will do what I need

Thanks :-)

Rob
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 Go to previous message
Heinz Stege is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Find the nearest location only on left/right side in SRCOR and MATCH_2D function
Next Topic: Moving colored lines smoothly on a gray-scale image

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

Current Time: Wed Oct 08 17:44:08 PDT 2025

Total time taken to generate the page: 0.00482 seconds