Re: problem with color graph with idl 5.0 Win95 version [message #14183] |
Wed, 03 February 1999 00:00 |
rmlongfield
Messages: 68 Registered: August 1998
|
Member |
|
|
In article <MPG.1120e75bda4a1f429896da@news.frii.com>,
davidf@dfanning.com (David Fanning) wrote:
> to know what color is associated with which index. The program
> CINDEX from my anonymous ftp site is useful for this purpose:
>
> ftp://ftp.dfanning.com/pub/dfanning/outgoing/misc/cindex.pro
Hi all,
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)
Rose
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
|
|
|
Re: problem with color graph with idl 5.0 Win95 version [message #14277 is a reply to message #14183] |
Wed, 03 February 1999 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Rose (rmlongfield@my-dejanews.com) writes about my CINDEX
program:
> 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
to the DEVICE command (GET_VISUAL_DEPTH, GET_VISUAL_NAME,
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. :-)
Cheers,
David
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
|
|
|