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

Home » Public Forums » archive » Re: Everything I always wanted to know about IDL * but were afraid to ask. Chapter1
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: Everything I always wanted to know about IDL * but were afraid to ask. Chapter1 [message #36938 is a reply to message #36937] Fri, 14 November 2003 04:44 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
df23775@hotmail.com writes:

> *A=[*A, next_value]
> As many times as the values I want to add to the pointer.
>
> I can print the whole pointer with PRINT, *A. But how can I get intermediate
> positions??.

You subscript like any normal IDL variable. The only
trick is knowing that pointer dereferencing has (generally)
lower precedence than almost everything else. So we throw
a lot of parentheses around when we are working with pointers.

values = (*A)[4:6]
*A = [(*A)[0:6], new_Value, (*A)[7:*]]


> As far as I can recall from my C classes I do believe that in C, A means the
> memory position pointed by A, in what we could call the first pointer
> positions and you could use a counter to get further position with a syntax
> like *(A+counter) In IDL *A means not only the memory position pointed by A
> but also the full contents of the pointer?

Forget what you learned about C pointers. IDL pointers
are NOT C pointers. Think of them as regular IDL variables
that live in global memory space and you will be MUCH
further ahead. :-)

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http:/www.dfanning.com/
Phone: 970-221-0438, IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Previous Topic: Everything I always wanted to know about IDL * but were afraid to ask. Chapter1
Next Topic: Matrix multiplication

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

Current Time: Tue Dec 02 17:43:38 PST 2025

Total time taken to generate the page: 0.40103 seconds