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

Home » Public Forums » archive » Re: IDL variables
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: IDL variables [message #36031] Fri, 08 August 2003 15:07
dbarkats is currently offline  dbarkats
Messages: 3
Registered: August 2003
Junior Member
rigby@crd.ge.com (Wayne Rigby) wrote in message news:<a2190b23.0308080542.2dba663e@posting.google.com>...
> dbarkats@princeton.edu (Denis Barkats) wrote in message news:<5b684bf6.0308071453.4cd2ff0f@posting.google.com>...
>> Hi,
>> I am new to this newsgroup posting thingy.
>> I would like to know if there is a way to get IDL to just print the
>> variables in its memory without having to also print all the used
>> functions and procdures. I 've tried typing : help but that always
>> returns a lot of other things.
>> The reason is that I would like to be able to delete variables fast.
>> For exemple, get a list of the varaibles names and delete all the
>> ones that start with the letter s.
>
> These might be what you're looking for:
>
> help, names='s*' (all variables that start with 's')
> help, names='*' (all variables)
>
> --Wayne

Thanks Wayne and David,
that helps.

-- AND yes, as a rule people like me who came to programming through
IDL in order to analyse data and such most often nee work on their
programming skills---

--
DEnis
Re: IDL variables [message #36035 is a reply to message #36031] Fri, 08 August 2003 08:44 Go to previous message
mvukovic is currently offline  mvukovic
Messages: 63
Registered: July 1998
Member
David Fanning <david@dfanning.com> wrote in message news:<MPG.199c9065ec03b7739896d0@news.frii.com>...
> Denis Barkats writes:
>
>> I am new to this newsgroup posting thingy.
>> I would like to know if there is a way to get IDL to just print the
>> variables in its memory without having to also print all the used
>> functions and procdures. I 've tried typing : help but that always
>> returns a lot of other things.
>
> OK, here is a routine that does this, but it is
> totally illegal, bogus, etc., and you didn't get
> it from me. :-(
>
> You will need my UNDEFINE program to make it work
> elegantly. If you don't need elegance, just delete
> that line.
>
> ;****************************************************
> PRO Help_Var
>
> ; Just print out the damn variables!
>
> names = ROUTINE_NAMES(Variables=1)
>
> FOR j=0, N_Elements(names) - 1 DO BEGIN
> IF N_Elements(ROUTINE_NAMES(names[j], FETCH=1)) GT 0 THEN BEGIN
> value = ROUTINE_NAMES(names[j], FETCH=1)
> HELP, value, Output=s
> UnDefine, value
> Print, StrUpCase(names[j]) + StrMid(s, 6)
> ENDIF
> ENDFOR
>
> END
> ;****************************************************
>

etc ...

Hmmm,

What is ROUTINE_NAMES? I could not find it documented in IDL6, nor on
the Fanning web site. Could it be an undocumented routine?

Thanks,

Mirko
Re: IDL variables [message #36036 is a reply to message #36035] Fri, 08 August 2003 06:42 Go to previous message
rigby is currently offline  rigby
Messages: 16
Registered: September 1995
Junior Member
dbarkats@princeton.edu (Denis Barkats) wrote in message news:<5b684bf6.0308071453.4cd2ff0f@posting.google.com>...
> Hi,
> I am new to this newsgroup posting thingy.
> I would like to know if there is a way to get IDL to just print the
> variables in its memory without having to also print all the used
> functions and procdures. I 've tried typing : help but that always
> returns a lot of other things.
> The reason is that I would like to be able to delete variables fast.
> For exemple, get a list of the varaibles names and delete all the
> ones that start with the letter s.

These might be what you're looking for:

help, names='s*' (all variables that start with 's')
help, names='*' (all variables)

--Wayne
Re: IDL variables [message #36040 is a reply to message #36036] Thu, 07 August 2003 16:47 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> OK, here is a routine that does this, but it is
> totally illegal, bogus, etc., and you didn't get
> it from me. :-(

Oh, oh, I can already hear Craig's and JD's fingers
pounding the keys. :-(

Yes, I know ways to make this more useful from
within any program unit and not just from the
main level, too, but remember: YOU DIDN'T GET
IT FROM ME!

Cheers,

David

P.S. You would think after all this time I would know
how to wait 5 damn minutes before publishing some great,
new idea! :-(

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: IDL variables [message #36041 is a reply to message #36040] Thu, 07 August 2003 16:36 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Denis Barkats writes:

> I am new to this newsgroup posting thingy.
> I would like to know if there is a way to get IDL to just print the
> variables in its memory without having to also print all the used
> functions and procdures. I 've tried typing : help but that always
> returns a lot of other things.

OK, here is a routine that does this, but it is
totally illegal, bogus, etc., and you didn't get
it from me. :-(

You will need my UNDEFINE program to make it work
elegantly. If you don't need elegance, just delete
that line.

;****************************************************
PRO Help_Var

; Just print out the damn variables!

names = ROUTINE_NAMES(Variables=1)

FOR j=0, N_Elements(names) - 1 DO BEGIN
IF N_Elements(ROUTINE_NAMES(names[j], FETCH=1)) GT 0 THEN BEGIN
value = ROUTINE_NAMES(names[j], FETCH=1)
HELP, value, Output=s
UnDefine, value
Print, StrUpCase(names[j]) + StrMid(s, 6)
ENDIF
ENDFOR

END
;****************************************************

> The reason is that I would like to be able to delete variables fast.
> For exemple, get a list of the varaibles names and delete all the
> ones that start with the letter s.

Yeah, well, if you need to do this, I'd guess the chances
are probably better than even you need some work on
your programming style. :-)

But I leave it as an exercise for the reader to develop
a method that can use regular expressions to search out
variables for deletion. I can't think of a way. I'm
pretty sure that even this hocus-pocus isn't strong
enough magic to do it.

> PS: and Oh, if D. Fanning reads this, I must already thank him
> enourmously for all the tips and programs on his web page withouty
> which I would not be finishing my thesis. Thanks

Oogh. This makes all the effort worthwhile! Thanks. :-)

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Tool to convert IDL to C++ ??
Next Topic: Error Handling - Emailing

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

Current Time: Wed Oct 08 13:17:43 PDT 2025

Total time taken to generate the page: 0.01356 seconds