Re: Yet again, The Sky is Falling! [message #53034 is a reply to message #52840] |
Mon, 12 March 2007 17:25  |
JD Smith
Messages: 850 Registered: December 1999
|
Senior Member |
|
|
On Fri, 09 Mar 2007 10:25:41 +0100, Paolo Grigis wrote:
> Here's a simple example of a routine that returns different values if it
> is called by value or by reference.
>
> pro pg,a,b
>
> b=arg_present(a)
>
> end
>
>
> IDL> x=1
> IDL> pg,x,b
> IDL> print,b
> 1
>
> IDL> pg,x+0,b
> IDL> print,b
> 0
>
> IDL> pg,x[0],b
> IDL> print,b
> 0
That's a bit of a contrived example, given that the whole reason I
originally lobbied for ARG_PRESENT was so you could differentiate between
by-value and by-reference arguments (which I observed IDL's own internal
routines could do, so clearly it was functionality waiting to be exposed).
JD
|
|
|