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

Home » Public Forums » archive » repeat.. until loops
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
repeat.. until loops [message #15937] Sat, 26 June 1999 00:00 Go to next message
Craig Aranjo is currently offline  Craig Aranjo
Messages: 3
Registered: June 1999
Junior Member
Why does this not work in IDL??

repeat begin
if img(i, half_col) ge 245 then row_start = i $
else i = i + 1
endrep $
until img(i, half_col) ge 245


I am looking at a binary image for the first white pixel halfway down the
image (moving inwards).
It always gives me an error that exceeds the maximum row valuie of the
image.


Any ideas.... I'm sure this is a really silly question.
Re: repeat.. until loops [message #16107 is a reply to message #15937] Mon, 28 June 1999 00:00 Go to previous message
Pavel Romashkin is currently offline  Pavel Romashkin
Messages: 166
Registered: April 1999
Senior Member
Hi Craig,
In the code you sent "i" is not defined. If it is not defined earlier, then
indexing and assigning will fail. Also, why not use WHERE function since
you leave the "repeat" loop anyway once you located the pixel you want?
Good luck,
Pavel

Craig Aranjo wrote:

> Why does this not work in IDL??
>
> repeat begin
> if img(i, half_col) ge 245 then row_start = i $
> else i = i + 1
> endrep $
> until img(i, half_col) ge 245
>
> I am looking at a binary image for the first white pixel halfway down the
> image (moving inwards).
> It always gives me an error that exceeds the maximum row valuie of the
> image.
>
> Any ideas.... I'm sure this is a really silly question.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Crazy use of MAX function.
Next Topic: Specifying DOUBLE precision and using WHERE

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

Current Time: Sat Oct 11 22:06:46 PDT 2025

Total time taken to generate the page: 8.47985 seconds