Re: how to use _EXTRA convention [message #13109 is a reply to message #13108] |
Fri, 09 October 1998 00:00  |
mirko_vukovic
Messages: 50 Registered: January 1998
|
Member |
|
|
In article <NOSPAM.98Oct9090301@pickering.ll.mit.edu>,
nospam@ll.mit.edu (Joseph Scott Stuart) wrote:
>
> I'm a little confused about the _EXTRA convention for passing
> parameters to a function works. I'm writing a routine to use with
> mpfit (thanks to Craig B. Markwardt), and I want to pass in some extra
> arguments via the functargs command. The mpfit procedure calls the
> function that I specify like this:
>
> fp = call_function(fcn, xp, _EXTRA=fcnargs)
>
> So, if fcnargs = { X: Xvals, Y: Yvals, Err:Evals, D:dval, G:gval }
>
> then do I define my function like this:
>
> function myfunct, P, X=x, Y=y, Err=err, D=d, G=g
>
> or like this:
>
> function myfunct, P, _EXTRA=e
> x = e.X
> y = e.Y
> err = e.Err
> d = e.D
> g = e.G
>
> Or something else entirely?
>
> thanks,
> scott
>
> --
> Scott Stuart
> stuart at ll mit edu
>
The call is:
fp = call_function(fcn, xp, X=x, Y=y, Err=err, D=d, G=g)
the function is:
function myfunct, P, X=x, Y=y, Err=err, D=d, G=g
And the explanation is:
MPFIT code looks like
PRO MPFIT, <<mpfit arguments>>, _extra=OtherKeywords
and inside its bowels, it makes a call that is essentially
result=func,_extra=OtherKeywords
IDL packages all the keywords that MPFIT does not need into
OtherKeywords, and passes them to func. Func will then pick
the stuff it needs from OtherKeywords.
Good luck,
Mirko
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
|
|
|