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

Home » Public Forums » archive » Re: [Q]Passing parts of structure arrays between routines
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: [Q]Passing parts of structure arrays between routines [message #6860] Fri, 23 August 1996 00:00
Tim Patterson is currently offline  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 Go to previous message
pit is currently offline  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
____________________________________________________________ ______________
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: How to size plots on a postscript device?
Next Topic: GRID3

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

Current Time: Wed Oct 08 18:41:53 PDT 2025

Total time taken to generate the page: 0.00419 seconds