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

Home » Public Forums » archive » Re: 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
Re: Weirdest Error Ever [message #50758 is a reply to message #50756] Wed, 18 October 2006 10:44 Go to previous messageGo to previous message
Foldy Lajos is currently offline  Foldy Lajos
Messages: 268
Registered: October 2001
Senior Member
On Wed, 18 Oct 2006, David Fanning wrote:

> 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.")
>

Hi David,

don't you have a 1D array named Reverse somewhere? Have you tried
compile_opt strictarr?

regards,
lajos
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: fast search
Next Topic: shapiro wilks test

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

Current Time: Wed Oct 08 18:12:27 PDT 2025

Total time taken to generate the page: 0.00228 seconds