I think this is a language syntax convention that IDL borrowed from C. The use in GAUSSFIT, I believe, is:
c = POLY_FIT(x, y, (nt eq 4) ? 0 : 1, yf)
The literal meaning in an alternative longer code statement is:
IF nt EQ 4 THEN $
c = POLY_FIT(x, y, 0, yf) $
ELSE $
c = POLY_FIT(x, y, 1, yf)
Many C programmers (and perhaps Java programmers as well) have used this not-very-intuitive-but-much-shorter syntax since their schooling, so we DO see it often IDL's 'lib' .pro files. If you practise with it a few times, you get used to it. IDL's Online Help discusses it in the index topic "?: ternary operator".
Bien a vous,
James Jones
|