Re: Return array from a pro [message #77932] |
Mon, 17 October 2011 11:58 |
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  |
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  |
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
|
|
|