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

Home » Public Forums » archive » Very basic IDL vector question
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: Very basic IDL vector question [message #93154 is a reply to message #93153] Tue, 03 May 2016 05:32 Go to previous messageGo to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Tuesday, May 3, 2016 at 1:08:11 PM UTC+1, kubota wrote:
> Hi Helder, you've made the two possible answers for fc (scalar or vector) very clear by your two examples. Thank you.
>
> Continuing on, if the two function calls were, for some reason, called in reverse order, with the testDouble call done first, then fc will become an array with values, 0, 2, 4,.. 18.
> If we then call testTotal with the same xc values (0 to 9), how does fc deal with the scalar result given that it is (currently) an array? Does fc change from an array to a scalar, with the result 45? If so, I presume all the previous (0,2,4, .. 18) 10 array values are lost at that moment?
>
> Thanks again.

I think that the question you're asking is "is the parameter xc passed by reference or value?"
What this asks is if the function you're calling will in the process affect the original data contained in xc (passed by reference) or not (passed by value).

Have a look at this article for clarification:
http://www.harrisgeospatial.com/docs/parameter_passing_mecha n.html

If you're unsure, test like this:

fun = 'testTotal'
xc = findgen(10)
print, 'before', xc
fc = call_function(fun,xc)
print, 'after', xc

of course for both functions.

Cheers,
Helder
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Help - IDL Basic Question
Next Topic: syntax for calling parent class _overloadPlus method

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

Current Time: Wed Oct 08 11:45:06 PDT 2025

Total time taken to generate the page: 0.00406 seconds