Curious Keywords [message #8395] |
Thu, 27 February 1997 00:00 |
J.D. Smith
Messages: 214 Registered: August 1996
|
Senior Member |
|
|
Hi folks,
A Keyword question:
I was curious how IDL built-ins can distiguish a passed keyword with an
undefinded variable from a keyword never passed at all, and why this
feature is not implemented in the language itself.
E.G. :
I can say (for some undefined variable UNDEF):
plot, findgen(100), findgen(100)/99.*2*!PI,POLAR=UNDEF
and get a straight line. (Or I can set UNDEF=1 and get a spiral o'
Archimedes).
I cannot, however, say:
plot, findgen(100), findgen(100)/99.*2*!PI, THICK=UNDEF
Since this generates an "a undefined" error message. This implies that
plot *knows* I am using the keyword "THICK", even when I am passing an
undefined variable -- a possibility which most of us discovered the hard
way is not implementable in IDL code. That is, if IDL's plot routine
were written in IDL code, the previous call would be equivalent, for all
practical purposes, to a call in which the keyword were ommitted.
Any thoughts?
JD
|
|
|