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 #33943] Thu, 06 February 2003 09:57 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
"Isa Usman" <eepisu@bath.ac.uk> writes:

> 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;

As other readers have pointed out, you can use common blocks in
functions. But, that's still not the greatest programming practice.
For example, what if you end up needing a double integral? Common
blocks will not survive the nested call.

I have a function integrator on my web page named QPINT1D that allows
you to pass arbitrary data to the function via two methods. The first
method is to pass data in a structure. Obviously you can arrange the
structure any way you like. The second way is to pass the data using
keywords. This also involves passing in a structure, and then QPINT1D
uses the _EXTRA mechanism, which causes the named structure elements
to be converted to named keywords in the function call.

Good luck,
Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[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: Fri Oct 10 10:01:36 PDT 2025

Total time taken to generate the page: 1.67993 seconds