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

Home » Public Forums » archive » Re: accesing variables defined in a higher program level
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: accesing variables defined in a higher program level [message #33947 is a reply to message #33943] Thu, 06 February 2003 08:53 Go to previous messageGo to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Isa Usman wrote:
> Hello,
>
> I am trying to get a function to use variable values that are defined in a
> higher level procedure. Since COMMON blocks can't be used in functions is
> there a way round this? here is an example of what i am trying to do;
>
> Pro high_level
> x=1
> y=1
> z=1
>
> I=integrate('f_x',z)
> end
>
> function integrate,z
> ........
> ........
> call function f_x
> i=........
> return,i
> end
>
> function f_x, z
> w=x+y+z
> return, w
> end
>
> Many thanks
>
> Isa
>
>
>

Dear Isa

I don't like common blocks but I am a bit surprised that they should not
work in functions. I can't believe this.


What is the reason for using all these call functions ?

Why did you not define

function f_x, x,y,z
w=x+y+z
return, w

and call this directly by high_level like

Pro high_level
x=1
y=1
z=1

I=f_x(x,y,z)
end


regards

Reimar


--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
============================================================ =======
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: accesing variables defined in a higher program level
Next Topic: Postscript output mods

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

Current Time: Sat Oct 11 00:56:13 PDT 2025

Total time taken to generate the page: 0.16410 seconds