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

Home » Public Forums » archive » Re: Pass by value and performance
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: Pass by value and performance [message #46700 is a reply to message #46698] Wed, 14 December 2005 09:54 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Kenneth P. Bowman writes:

> Perhaps someone can clarify this for me.
>
> I was doing this
>
> data = {values : FLTARR(...), $
> other : other stuff ...}
>
> Then pass "data" to a procedure and do this
>
> result = INTERPOLATE(data.values, x, y, z)
>
> In this case data.values is passed by reference. (p. 92 of Building IDL
> Applications)
>
>
> If I were to use pointers, I could do something like this instead
>
> data = {values : PTR_NEW(FLTARR(...)), $
> other : other stuff ...}
>
> Pass "data" to a procedure and do this
>
> result = INTERPOLATE(*data.values, x, y, z)
>
> Is *data.values passed by reference or by value? And how does one tell?

I would test it with my little JUNK program from before,
like so:

IDL> b = {ptr:Ptr_New(5)}
IDL> junk, *b.ptr
IDL> help, *b.ptr
<PtrHeapVar26> INT = 25

Whoa! Excuse me. I need to do a little more work on that
pointer chapter.

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: idl job posting
Next Topic: Recursive Function Program in IDL

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

Current Time: Fri Oct 10 03:09:43 PDT 2025

Total time taken to generate the page: 1.43871 seconds