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

Home » Public Forums » archive » Re: structure arguments sometimes behave like value types - why?
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: structure arguments sometimes behave like value types - why? [message #53604 is a reply to message #53603] Fri, 20 April 2007 14:26 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
justspam03@yahoo.de writes:

> according to the IDL reference, structures (as a whole) are treated
> like reference types when supplied as an argument. A small test
> program of the kind
> confirms this - after the call to changeval, a.value has value '4'.
> However, when the structure is an object variable as in the example
> appended below, it seems that only a copy of structtest.val is
> exchanged, not a reference to it. The final call to printValue in
> 'main' prints a '1'.
> Could someone please explain why?

In one case you are passing an IDL variable, which is passed
by reference. In the other you are passing a structure reference,
which is NOT an IDL variable, and like everything else that is NOT
an IDL variable, is passed by value:

http://www.dfanning.com/tips/read_subscripted_array.html

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Disavow Any Inaccuracies
Next Topic: surface vs. shade_surf

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

Current Time: Wed Oct 08 17:34:39 PDT 2025

Total time taken to generate the page: 0.00187 seconds