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

Home » Public Forums » archive » A strange behaviour of parameters passing
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: A strange behaviour of parameters passing [message #15726 is a reply to message #15630] Thu, 03 June 1999 00:00 Go to previous message
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
Senior Member
Daniel SAGE wrote:
> Who can explain me the strange behaviour when I passed my parameters ?
> I create a small and stupid example to see the disfunctionning of IDL.
> Why the first call of the procedure 'one' returns 1 and the second call
> return 2 ? According the documentation of IDL, the second calling is
> correct but not the first calling.
[code removed]

I believe IDL is doing what it is supposed to do.

In the first call (one, a[*]), you are passing a subscripted array (even
though you requested all elements). Subscripted arrays are passed by
value and *cannot* be modified in the called procedure.

In the second call (one, a), you are passing an entire array. Entire
arrays are passed by reference and *can* be modified in the called
procedure.

Cheers,
Liam.

--
Liam E. Gumley
Space Science and Engineering Center, UW-Madison
http://cimss.ssec.wisc.edu/~gumley
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: regular expressions
Next Topic: Re: Making MPEG Movies

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

Current Time: Sun Nov 30 02:48:41 PST 2025

Total time taken to generate the page: 0.40180 seconds