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

Home » Public Forums » archive » Re: Passing more than one variable out of a function.
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: Passing more than one variable out of a function. [message #65828] Thu, 26 March 2009 06:12 Go to previous message
Mike[2] is currently offline  Mike[2]
Messages: 99
Registered: December 2005
Member
On Mar 25, 4:14 am, philipel...@googlemail.com wrote:

> The important thing to notice is that RETURN can accept an
> array as a parameter.

RETURNing anonymous structures is a handy way to pass back results
with mixed types. As in:

function do_this, x
result = {timestamp: systime(), $
mean: mean(x), $
min: min(x), $
value:some_other_calculation_using_x(x) $
}
return(result)
end

foo = do_this(x)
print, foo.timestamp
print, foo.mean
print, foo.min
print, foo.value


Regards, Mike
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Symsize doesn't seem to work?
Next Topic: Re: Help With Finding Local Maxima of an Image (locmax)

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

Current Time: Wed Oct 08 15:52:39 PDT 2025

Total time taken to generate the page: 0.00437 seconds