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

Home » Public Forums » archive » Re: how to use _EXTRA convention
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: how to use _EXTRA convention [message #13109 is a reply to message #13108] Fri, 09 October 1998 00:00 Go to previous message
mirko_vukovic is currently offline  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
[Message index]
 
Read Message
Read Message
Previous Topic: CDF vs. netCDF
Next Topic: IDL procedure for satellite orbits

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

Current Time: Fri Oct 10 11:37:34 PDT 2025

Total time taken to generate the page: 0.23734 seconds