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

Home » Public Forums » archive » Re: Return array from a pro
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Return array from a pro [message #77932] Mon, 17 October 2011 11:58
Zhang Bo is currently offline  Zhang Bo
Messages: 22
Registered: October 2011
Junior Member
On Oct 17, 4:41 am, Carsten Lechte <c...@toppoint.de> wrote:
> On 17/10/11 03:24, Zhang Bo wrote:
>
>> I have a subpro doing some calculation and I want to pass the result
>> (several arrays) to the upper level? How to do this? or it is not
>> allowed?
>
> Just pass it as an argument:
>
> IDL> .comp
> - PRO test, arr
> - arr= indgen(4)
> - end
> % Compiled module: TEST.
> IDL> help, asdf
> ASDF            UNDEFINED = <Undefined>
> IDL> test, asdf
> IDL> help, asdf
> ASDF            INT       = Array[4]
> IDL>
>
> chl

Thanks a lot!
Re: Return array from a pro [message #77942 is a reply to message #77932] Mon, 17 October 2011 01:41 Go to previous message
Carsten Lechte is currently offline  Carsten Lechte
Messages: 124
Registered: August 2006
Senior Member
On 17/10/11 03:24, Zhang Bo wrote:
> I have a subpro doing some calculation and I want to pass the result
> (several arrays) to the upper level? How to do this? or it is not
> allowed?

Just pass it as an argument:


IDL> .comp
- PRO test, arr
- arr= indgen(4)
- end
% Compiled module: TEST.
IDL> help, asdf
ASDF UNDEFINED = <Undefined>
IDL> test, asdf
IDL> help, asdf
ASDF INT = Array[4]
IDL>



chl
Re: Return array from a pro [message #77943 is a reply to message #77942] Sun, 16 October 2011 19:28 Go to previous message
SonicKenking is currently offline  SonicKenking
Messages: 51
Registered: October 2010
Member
On Oct 17, 12:24 pm, Zhang Bo <bzhang20071...@gmail.com> wrote:
> I have a subpro doing some calculation and I want to pass the result
> (several arrays) to the upper level? How to do this? or it is not
> allowed?

you can use output keywords as follows:

pro subpro, a=a, b=b
a = some_calculation_1()
b = some_calculation_2()
end
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Matrix in IDL
Next Topic: Pass variables into Newton or BROYDEN for solving non-linear equations

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

Current Time: Wed Oct 08 15:37:41 PDT 2025

Total time taken to generate the page: 0.00428 seconds