Re: Passing zero as a Parameter/ NOT KEYWORD_SET [message #16054 is a reply to message #16040] |
Wed, 30 June 1999 00:00   |
Martin Schultz
Messages: 515 Registered: August 1997
|
Senior Member |
|
|
Martin Schultz wrote
and D. Fanning, R. Bauer and J.D. Smith replied
[...]
oh well! Just when I for once thought I knew IDL ;-(
(1) I confess: I confused IF with KEYWORD_SET. It is still sometimes
enstranging that
IF (2) THEN PRINT,'TRUE'
will not print anything...
(2) Of course, n_elements(var) eq 1 only makes sense when you expect a
scalar. Guess, I wasn't clear enough here. It's just that I sometimes
found I was running into trouble with ambiguous keywords such as COLOR
which can occasionally be a vector (see SPLOT), but must be scalar on
(most) other occasions. Now the test 'EQ 1' is of course only suitable
for the 'other occasions'.
(3) Reimar Bauer makes a good point that you want to define a variable
locally if you want to make sure not to pass it back (however, I often
find that passing previously undefined variables back is useful)
Gotta go back and learn some more ;-)
Martin
|||||||||||||||\\\\\\\\\\\\\-------------------///////////// //|||||||||||||||
Martin Schultz, DEAS, Harvard University, 29 Oxford St., Pierce 109,
Cambridge, MA 02138 phone (617) 496 8318 fax (617) 495 4551
e-mail mgs@io.harvard.edu web http://www-as/people/staff/mgs/
|
|
|