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

Home » Public Forums » archive » Re: delete variable name from memory
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: delete variable name from memory [message #44259] Thu, 02 June 2005 10:21 Go to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Thu, 02 Jun 2005 14:25:46 +0200, David Fanning wrote:

> saplizki@gmail.com wrote:
>
>> I need to delete my variable from the variable name list.
>> but i don't locate at the top level (i'm in a gui program) so i can't
>> 'delvar' it.
>> also i can't (don't want to) zero it because it won't remove from the
>> variable list (when i press help or use ROUTINE_NAMES or ROUTINE_INFO)
>> and i use that list at my program.
>
> Try UNDEFINE:
>
> http://www.dfanning.com/programs/undefine.pro

Note that there is a difference between a deleted variable and an
undefined variable:

IDL> a=12

IDL> help
% At $MAIN$
A INT = 12

IDL> delvar,a

IDL> help
% At $MAIN$

IDL> a=12

IDL> undefine,a
% Compiled module: UNDEFINE.

IDL> help
% At $MAIN$
A UNDEFINED = <Undefined>

IDL> print,routine_info('$MAIN$',/VARIABLES)
A


I.e. the TEMPORARY tricks leave a reference to the variable as
UNDEFINED, whereas DELVAR removes any notion of ever having seen such
a variable. They are equivalent if you are using, e.g., N_ELEMENTS()
eq 0 as a test for a variable's presence, since whether a variable is
non-existent, or exists but is undefined, N_ELEMENTS is 0. An
undefined variable, however, is still a variable, and will show up in
ROUTINE_INFO, among other places.

JD
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: goetiff reading routine for idl 5.1
Next Topic: Re: C/C++ conversion to IDL

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

Current Time: Fri Oct 10 14:45:16 PDT 2025

Total time taken to generate the page: 1.12182 seconds