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

Home » Public Forums » archive » RETURN
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: RETURN [message #86816 is a reply to message #86810] Wed, 04 December 2013 18:21 Go to previous messageGo to previous message
Matthew Argall is currently offline  Matthew Argall
Messages: 286
Registered: October 2011
Senior Member
On Wednesday, December 4, 2013 6:33:03 PM UTC-5, fd_...@mail.com wrote:
> If I want to return more than one?
>
>
>
> I.e. a[1,2]
>
> b=[2,3]
>
>
>
> return, a+b, 2*a
>
>
>
> It says that the return statement in functions must have 1 value.

Functions in IDL are not like functions in, e.g., MatLab. You can only return one value. To do this, you must use a procedure and put the output variables in the calling statement.

pro foo, a, b, a_plus_b, twoa
a_plus_b = a + b
twoa = 2*a
end

;-----------------
a = [1,2]
b = [2,3]

foo, a, b, c, d

print, b, c
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: plotting missing values
Next Topic: PS fonts

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

Current Time: Sun Oct 12 05:33:13 PDT 2025

Total time taken to generate the page: 1.36128 seconds