Re: OO IDL [message #41038 is a reply to message #41035] |
Wed, 15 September 2004 20:47   |
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
------------------------------------------------------------ --------------
|
|
|