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

Home » Public Forums » archive » Weirdest Error Ever
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Weirdest Error Ever [message #50760] Wed, 18 October 2006 10:37
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Folks,

I've been working this morning on an error that is so
weird I'm beginning to think it is possible I have
completely lost my mind.

The error occurs in my COLORBAR routine. I have two
files. The files are identical, except for the following
line.

File that works perfectly:

bar = BYTSCL(bar, TOP=(ncolors-1 < (255-bottom))) + bottom

File that fails:

bar = BYTSCL(bar, TOP=(ncolors-1) < (255-bottom)) + bottom

In both files, the following three lines follow the line above:

IF Keyword_Set(reverse) THEN BEGIN
bar = Reverse(bar,1)
ENDIF

The variable bar is defined originally like this:

bar = BINDGEN(ncolors) # REPLICATE(1B, 20)

where ncolors is 256, so it is a 256 by 20 byte array. The variable
bottom is 0.

The error occurs on the line containing REVERSE. Here is the error:

IDL> Colorbar, /Reverse
Subscript range values of the form low:high must be >= 0, < size,
with low <= high: REVERSE.
Error occurred at: COLORBAR 286 C:\RSI\IDL Course\colorbar.pro
$MAIN$
Execution halted at: $MAIN$

Oddly, REVERSE, which is an IDL library routine is *not* compiled
when the error occurs, and I am certain the error is not coming from
REVERSE, because I can't step into REVERSE as I try to debug the
program. I think the error is a system error from IDL

Even MORE oddly, if I start a fresh session and compile REVERSE
before I do anything else, the program that fails works perfectly!!
If I start a fresh session and compile the program that fails, then
compile REVERSE, then run the program, it *still* fails.

Here is the result of HELP, /SOURCE in the latter case, which
is *identical* to the same command in the former case:

IDL> help, /source
Compiled Procedures:
$MAIN$
COLORBAR C:\RSI\IDL Course\colorbar.pro

Compiled Functions:
REVERSE C:\RSI\IDL62\lib\reverse.pro

If I start a fresh session and just try to execute the code that
seems to be giving me problems here, I have NO problem!

IDL> ncolors=256
IDL> bottom=0
IDL> bar = BINDGEN(ncolors) # REPLICATE(1B, 20)
IDL> bar = BYTSCL(bar, TOP=(ncolors-1) < (255-bottom)) + bottom
IDL> bar = reverse(bar, 1)
Compiled module: REVERSE.

Does anyone have the foggiest idea of what could be going on here!?

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Previous Topic: a slip of the fingers
Next Topic: Re: How to Sort/Uniq a list and keep its original index

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

Current Time: Fri Oct 10 01:45:07 PDT 2025

Total time taken to generate the page: 0.16042 seconds