Re: HELP! Annoying IDL glitches... [message #6217 is a reply to message #6212] |
Fri, 17 May 1996 00:00   |
hahn
Messages: 108 Registered: November 1993
|
Senior Member |
|
|
deb <summa@lanl.gov> wrote:
> Here are some questions I'm hoping seasoned IDL users will be able to
> help me out with.
> 1. Why does STRMID always give a non-fatal error announcing that
> it cannot convert the given string to type Long? The function
> itself appears to extract the string expression properly.
You didn't give us an example, so I can only come up with a few
guesses:
The first parameter of STRMID is the string to extract from. Any
kind of type is allowed but the data will be converted to type
String. The other parameters of STRMID are required to be of
type Long: The position of the first character and the number of
bytes to extract. So it would be good to check what is passed as
second and third parameter.
> 2. Why does XLOADCT update color tables in real time on the Mac
> but not on the PC?
MS Windows leaves only 236 colors on a 256 color graphics board.
If you supply more than 236 colors interpolations take place.
Nevertheless, this should also occur in realtime...
> shouldn't it just pad the variable with blanks? Is there a way to read
> say 3 variables off a single line when one really only knows the format
> of the first two? ie, instead of readf,unit,format='(a34,F5.3,a80)',a,b,c,
> can one leave off that a80 and still expect to read 3 variables
> off the line (with the third variable being a string of arbitrary length)?
Your format statements forces IDL to read 34 bytes into variable a,
5 characters into variable b and 80 characters into variable c.
You can omit the field width if there aren't any blanks among the
34 characters or among the 80 characters in the third field.
Thus if you write format='(A,F5.3,A)' the first variable will get all
characters from the begining of the line up to and excluding the
first blank. If there are less than 34 characters in the first "word"
those characters are transmitted to the variable a and it length
will be adjusted.
> 4a. Along similar lines, why is it that on te Mac i can set graphics
> preferences to 256 colors and it works whereas on the PC i set the
> preferences to 256 colors and !D.n_colors still comes up with many more?
With MS Windows you can have either 236, 64k, or 16M colors.
256 colors are not available.
> Has anyone else run into similar problems and how did you fix them? ANy
> other
> pointers (no pun intended) on file i/o and/or Mac vs PC things to watch
> out for?
> Many thanks,
> -Deb Summa
> summa@lanl.gov
Norbert Hahn
|
|
|