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

Home » Public Forums » archive » Re: question on destroying objarr's
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: question on destroying objarr's [message #62064 is a reply to message #62063] Tue, 19 August 2008 11:57 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
cgoethel@igpp.ucla.edu writes:

> Does anyone have a simple example of how to create, populate, and
> destroy an objarr? I can create and populate (in a clumsy way) but
> then I am cannot get rid of it using OBJ_DESTROY.
>
> Thanks! Cindy
>
> EX:
>
> myObjArr=OBJARR(3)
> myObjArr[0]=someObj
> OBJ_DESTROY, myObjArr
>
> help, myObjArr
> MYOBJARR OBJREF = Array[3] (it's still there - why?)

Well, it's still there in the sense that variable myObjArr
is still listed as having been previously defined as
*something* in the IDL session. But all the objects in
that object array are null objects. You can't use them
for anything. They don't point to anything. They are not
taking up any space on the heap. Etc.

In other words, you are in great shape! :-)

If you want to get rid of it entirely, you will have to
do something like this:

IDL> myObjArr=OBJARR(3)
IDL> myObjArr[0]=Obj_New('idlanroi')
IDL> OBJ_DESTROY, myObjArr
IDL> Undefine, myObjArr
IDL> Help, myObjArr
MYOBJARR UNDEFINED = <Undefined>

You can find UNDEFINE here:

http://www.dfanning.com/programs/undefine.pro

Just don't undefine before you destroy!!!

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: 3D graphing
Next Topic: Re: Today's IDL Lesson

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

Current Time: Sun Oct 12 09:48:41 PDT 2025

Total time taken to generate the page: 0.39957 seconds