Re: [Q]Passing parts of structure arrays between routines [message #6860] |
Fri, 23 August 1996 00:00 |
Tim Patterson
Messages: 65 Registered: October 1995
|
Member |
|
|
Peter Suetterlin wrote:
>
> In article <321CE1F6.41C6@raptor.lpl.arizona.edu>,
> Tim Patterson <tim@raptor.lpl.arizona.edu> writes:
>
>> Is this use of temporary variables the only solution,
>> and why can't I get the 'correct' result using the
>> neater array_test procedure? I can't find anything under
>> 'arrays' or 'structures' in the IDL docs that say I shouldn't
>> be able to do it that way.
>
> Yes, it is, because IDL can pass subarrays only by value and not by
> reference. Therefore, you can never change the original variable.
> This is not restricted to structures but is valid for any kind of data
> that is (has to be) passed by value. See the part of the Manual about
> parameter passing in IDL.
>
> Peter
>
Thanks Peter, and to the others who emailed me.
Tim
|
|
|
Re: [Q]Passing parts of structure arrays between routines [message #6866 is a reply to message #6860] |
Fri, 23 August 1996 00:00  |
pit
Messages: 92 Registered: January 1996
|
Member |
|
|
In article <321CE1F6.41C6@raptor.lpl.arizona.edu>,
Tim Patterson <tim@raptor.lpl.arizona.edu> writes:
> I have an array of structures within my IDL code,
> and I would like to select just one structure from
> the array and pass it to another routine to have
> its contents altered.
[ does not work ]
> Is this use of temporary variables the only solution,
> and why can't I get the 'correct' result using the
> neater array_test procedure? I can't find anything under
> 'arrays' or 'structures' in the IDL docs that say I shouldn't
> be able to do it that way.
Yes, it is, because IDL can pass subarrays only by value and not by
reference. Therefore, you can never change the original variable.
This is not restricted to structures but is valid for any kind of data
that is (has to be) passed by value. See the part of the Manual about
parameter passing in IDL.
Peter
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
Peter "Pit" Suetterlin http://www.uni-sw.gwdg.de/~pit
Universitaets-Sternwarte Goettingen
Tel.: +49 551 39-5048 pit@uni-sw.gwdg.de
-- * -- * ...-- * -- * ...-- * -- * ...-- * -- * ...-- * -- * ...-- * --
Come and see the stars! http://www.kis.uni-freiburg.de/~ps/SFB
Sternfreunde Breisgau e.V. Tel.: +49 761 278588
____________________________________________________________ ______________
|
|
|