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

Home » Public Forums » archive » pointers in IDL
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: Pointers [message #16662 is a reply to message #8813] Mon, 09 August 1999 00:00 Go to previous messageGo to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Robert Leejoice (rleejoice@aol.com) writes:

> What are pointers used for in IDL. I only precieve that they lead to the new
> object paradyme. Is this correct? I use structures in most of my programming
> and pass the complete structure to the appropaite procedures. I suppose I
> could creat a pointer to a structure, but since IDL passes structures by
> reference, what is the need?

Pointers are used for all kinds of things, but I think
the most obvious good use of pointers is in structures.
(Or objects, which are implemented as named structures.)

Suppose, for example, that you have a field named IMAGE
in your structure. But the image data that is stored there
might vary in size and data type. Without pointers, you
would have to use an anonymous structure and redefine it
when the image data changed. With pointers, you can continue
to use a named structure with the IMAGE field a pointer to
whatever you like:

struct = {MYSTRUCT, Image:Ptr_New(image), ...}
*struct.image = newimage

Cheers,

David
--
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
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Realizing a widget only once
Next Topic: reading pixels from images from automated XYpositions

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

Current Time: Wed Oct 08 17:32:30 PDT 2025

Total time taken to generate the page: 0.00266 seconds