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

Home » Public Forums » archive » Re: Func define
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: Func define [message #19946] Sun, 07 May 2000 00:00 Go to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article <3914EBCF.64D4E023@crsa.bu.edu>, Yu Zhang
<yuzhang@crsa.bu.edu> wrote:

> I happen to have a small problem when I tried to do some
> integrations with IDL. For example, I want to use INT_2D or QSIMP to do
> a calculation. But I found out that the "Func" defined in these
> functions
> only have limited parameters (equal to dimension of integral you want to
> do).
> Other coefficiences must be fixed.
> What to do if I need more parameter in the defined function?
> (e.g. I need y=a*x+b and want to change a, b value outside)
> It seems strange that this shouldn't be difficult to consider,
> or I just fail to catch up the spirit of IDL.

A simple way to do this, although not the only way, is to include a
common block in the function.

FUNCTION MY_FUN, x

COMMON MY_FUN_PARAMETERS, a, b

RETURN, a + b*x
END

Regards, Ken Bowman
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Sharing an info structure
Next Topic: Interpolating over faults

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

Current Time: Fri Oct 10 10:26:25 PDT 2025

Total time taken to generate the page: 0.80183 seconds