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

Home » Public Forums » archive » Re: Undefining a variable a pointer points to
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: Undefining a variable a pointer points to [message #39332 is a reply to message #39321] Fri, 14 May 2004 14:30 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Benjamin Hornberger writes:

> is there a way to undefine the variable a pointer points to? E.g., if I
> initialize a pointer by
>
> p = ptr_new(/allocate_heap)
>
> p is a valid pointer, but *p is undefined. If I now do
>
> *p = 10
>
> is there a way to undefine it again afterwards, i.e. get back to the
> status right after the call to ptr_new(/allocate_heap)?

Well, not sure *why* you want to be doing this, but if
it's necessary, you can do this:

Ptr_Free, p
p = Ptr_New(/Allocate_Heap)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Previous Topic: allocate heap? yes or no?
Next Topic: virtual mosaic template format in ENVI

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

Current Time: Wed Oct 08 15:56:24 PDT 2025

Total time taken to generate the page: 0.00351 seconds