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 #46711 is a reply to message #46707] Wed, 14 December 2005 07:53 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:

> True, and I considered that possibility. It would work fine for passing
> the arrays amongst my own routines, but I have to dereference the
> pointer to pass the array itself into system routines. Dereferencing a
> pointer is an expression, is it not?, and expressions are passed by
> value.

Ah, you would be interested to read the new pointer
section of my book that I just completely yesterday!
(Well, actually, you could read the damn pointer tutorial
where I learned about this, too.) Here is the news that
even I didn't fully appreciate until I put it down in my
own words. Pointers are just regular IDL variables!!

Consider this function:

PRO JUNK, var
var = var * 5
END

And do this:

IDL> a = Ptr_New(5)
IDL> junk, *a

Here is the question. What is the result of this command?

IDL> Print, *a

The answer might surprise you! :-)

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 12:21:26 PDT 2025

Total time taken to generate the page: 0.00940 seconds