[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem with color graph with idl 5.0 Win95 version

Rose (rmlongfield@my-dejanews.com) writes about my CINDEX

> 	I found this program very useful except for one problem.
> I get an error message (IDl5.0 mipseb IRIX unix 5.0):
>  Keyword GET_VISUAL_DEPTH not allowed in call to: DEVICE
> This occurs because I am still running IDL5.0 (it runs ok on another machine
> with IDL5.1 installed).  I cannot find documentation on this keyword (online
> or on paper).  My question is: Is there a check (hopefully not using an error
> handler) which will tell me if this keyword is valid and, if not, use a
> different method for determining the color structure?  I have to bypass it
> somehow.  (I know, I know,  there are already too many checks for the various
> OS's and versions and colors)

This is all a bit complicated as you go through the 5.x
versions of IDL, since a number of bugs were fixed/introduced/fixed
that make it difficult to tell unambiguously and programmatically 
how many colors you have on your display.

If you are running on a PC or Mac, however, and !D.N_Colors
is greater than or *equal to* 256, then you have a visual
depth greater than 8, which is usually what you want to
know. On a UNIX workstation, if !D.N_Colors is greater
than 256, you have a depth greater than 8.

Alas, I've just removed *all* references to !D.N_Colors
from the latest edition of my book and I've banished it
from all my programs as it makes my life so damn hard. :-(
Instead, I'm now using !D.Table_Size and these new keywords
GET_DECOMPOSED) to sort this color stuff out. 

And I *always* encourage people to upgrade to the latest
version of IDL, even if it costs more money than you want
to spend. For me, it's a lot more expensive to spend all 
my time writing code to work around bugs. :-)



P.S. !Version.Release can be used to write version-specific
error handling code. :-)

David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155