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

Home » Public Forums » archive » Yet again, The Sky is Falling!
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: Yet again, The Sky is Falling! [message #52963 is a reply to message #52872] Fri, 09 March 2007 13:11 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
David Fanning wrote:
> Paul van Delst writes:
>
>>> 2. Don't pass the same named variable as both an input and output
>>> parameter in a routine call. (Or as two output parameters!)
>> Good lord. Why would anyone do *that*? (In any language) :o)
>
> Well, because it seems "natural", for one thing. Consider
> the POSITION keyword to TVIMAGE when you don't know for
> sure if the user wants to preserve the aspect ratio of the
> image or not, but you are keenly interested in knowing
> where the image ended up.

Well, of course. That's normal and I do that a lot (for the above purpose and also to
prevent memory leaks) in f95 all the time. The syntax would be

real, intent(in out) :: position(:)

> That's, uh, about the only example I can thing of at the
> moment, but it seems a good one. :-)

That's not how I interpreted Mike's post. I meant if given a procedure like:

pro mypro, input_var, output_var
output_var = input_var + 1.0
end

then don't call it thusly,

x = 1.0
mypro, x, x


I don't even know if it's possible in IDL... or f95..or C... or..? Hence my "why on
earth...?"

cheers,

paulv

--
Paul van Delst Ride lots.
CIMSS @ NOAA/NCEP/EMC Eddy Merckx
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: mpeg creation problem
Next Topic: reading many files

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

Current Time: Sat Nov 29 08:28:41 PST 2025

Total time taken to generate the page: 2.08464 seconds