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

Home » Public Forums » archive » Re: Curious Keywords
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: Curious Keywords [message #8394 is a reply to message #8390] Thu, 27 February 1997 00:00 Go to previous message
kspencer is currently offline  kspencer
Messages: 21
Registered: December 1993
Junior Member
John-David Smith <jdsmith@astrosun.tn.cornell.edu> writes:

> 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


The reason for this behavior is that the default value of UNDEF in both
cases is 0. For the POLAR keyword, supplying a 0 means don't do anything,
so it doesn't. But supplying 0 to THICK generates an error because the
line has to have *some* thickness to it.

Dig?

Kevin
-----------------------------------------------------------
Kevin Spencer
Cognitive Psychophysiology Laboratory and Beckman Institute
University of Illinois at Urbana-Champaign
kspencer@p300.cpl.uiuc.edu
-----------------------------------------------------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: The intersection of 2 arrays
Next Topic: Re: WTB 3D graph on an irregular grid

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

Current Time: Sat Oct 11 02:09:00 PDT 2025

Total time taken to generate the page: 1.91599 seconds