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

Home » Public Forums » archive » Re: OO IDL
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: OO IDL [message #41038 is a reply to message #41035] Wed, 15 September 2004 20:47 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Robert Barnett <retsil@zipworld.com.au> writes:
[ snip ]
>
> This means that I have to do lots of calls to CALL_FUNCTION becuase I
> only know what version I am to use at runtime.
...

I'm not sure I follow. I would normally only use CALL_FUNCTION once,
and decide on the function string to use at run-time. If you mean you
still have to select which function to use, well, yes, that's true,
but we are really only talking about a few lines of code here, right?

The other option is to code one function with many different cost
functions inside, and then select it using a keyword, as in:

function my_cost_function, ..., method=string

case strupcase(string) of
'MEMB': value = ...
'LB' : value = ...
'SR' : value = ...
end

return, value
end

This allows you to only have one file with many different functions.

You could do something similar with objects as well I guess.

Good luck,
Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: least square error for a regression
Next Topic: GDL 0.8.5 runs READFITS WRITEFITS

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

Current Time: Sat Oct 11 16:19:19 PDT 2025

Total time taken to generate the page: 1.52337 seconds