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

Home » Public Forums » archive » Re: structures, arrays of pointers and assignment
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: structures, arrays of pointers and assignment [message #53746 is a reply to message #53745] Wed, 02 May 2007 09:08 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Ingo von Borstel writes:

> But now I wonder why deleting an entry works:
>
> PRO delete_entry, trackvalues, number
> IF NOT PTR_VALID(trackvalues.value[number]) THEN BEGIN
> MESSAGE, "Trackvalues number is not a valid record. Nothing done",
> /CONTINUE
> RETURN
> ENDIF
> PTR_FREE, trackvalues.value[number]
> trackvalues.used[number] = 0
> trackvalues.description[number] = ''
> END
>
> IDL>delete_entry, sep213.trackvalues, 3
> will result in the deletion of the 3rd (or 4th, depends upon where you
> start counting) entry... Why the hell does this work then? Shouldn't
> work, if this was also passed by value...

Ah, because pointers are variables and are passed by reference:

http://www.dfanning.com/misc_tips/pointers.html

Isn't it exciting to learn about IDL? :-)

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
Read Message
Read Message
Previous Topic: HISTOGRAM and string data
Next Topic: Re: ENVI does a dumb thing reading a TIFF file with a palette included

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

Current Time: Sat Oct 11 07:17:13 PDT 2025

Total time taken to generate the page: 1.59466 seconds