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

Home » Public Forums » archive » undefined keyword variables
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: undefined keyword variables [message #17612 is a reply to message #17531] Mon, 01 November 1999 00:00 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Dusting off my degree in horse-beating...

davidf@dfanning.com (David Fanning) writes:
>
> I think it is not only feasible, but required, that you
> provide default values for *any* variable you plan
> to use in the code. Certainly if I were planning to
> use the POSITION keyword I would have something like this:
>
> IF N_Elements(thePosition) EQ 0 THEN thePosition=!P.Position
> ...
> Plot, data, Position=thePosition

This doesn't always work. Here is what happens when I examine
!p.position after starting IDL fresh:

IDL> print, !version
{ alpha OSF unix 5.2 Oct 30 1998}
IDL> print, !p.position
0.00000 0.00000 0.00000 0.00000

That causes an error when I try to plot. Anyway, your solution takes
the previous plot position. I was interested in using the IDL default
position. I haven't found any logical way to figure that out. [ Okay,
there's the plot,/nodata,xstyle=5,ystyle=5 technique to set up the
coordinates ahead of time. Hmmm... ] I run into this situation where
I have two paths in my code, one path where I set the POSITION, and
one where I just want to pass the user's value. Check out map_set.pro
and map_struct_append to see what contortions RSI went through.

My point is that *whatever* strategy that IDL uses to pass undefined
keywords appears to be inconsistent. It should either be documented
or corrected.

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Can this be vectorized?
Next Topic: change widget slider maximum dynamically?

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

Current Time: Sat Oct 11 15:27:51 PDT 2025

Total time taken to generate the page: 1.28044 seconds