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 
Return to the default flat view Create a new topic Submit Reply
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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
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: Fri Oct 10 18:39:28 PDT 2025

Total time taken to generate the page: 0.64116 seconds