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

Home » Public Forums » archive » Re: Help: Pointer
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: Help: Pointer [message #14890 is a reply to message #14885] Fri, 02 April 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
VU KHAC Tri (tvk@info.fundp.ac.be) writes:

> In C, I can write:
>
> void XXX ()
> {
> int C = 4;
> int *pC;
> pC = &C; /*pC points to C*/
> }
>
> I cannot find out how to do this in IDL ?

IDL> c = 4
IDL> pC = Ptr_New(/Allocate_Heap)
IDL> *pC = c

But most people would just to this:

IDL> pC = Ptr_New(c)

To destroy the pointer (and the thing it points to),
be sure to do this when you are finished:

IDL> Pointer_Free, pC

If you are writing a widget program you can clean up
your pointers in the CLEANUP procedure you assign
to your top-level base with the XMANAGER command.

Cheers,

David

P.S. People may be interested to know that a book is
winging its way to Tri today. :-)

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@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
Previous Topic: "ALOG2" ? (Ugly code follows)
Next Topic: "ALOG2" ?

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

Current Time: Tue Dec 02 07:43:50 PST 2025

Total time taken to generate the page: 0.08454 seconds