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

Home » Public Forums » archive » help with stopping criterion - use of BREAK
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: help with stopping criterion - use of BREAK [message #90118 is a reply to message #90116] Wed, 28 January 2015 09:46 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Wednesday, January 28, 2015 at 12:09:52 PM UTC-5, g.na...@gmail.com wrote:
> Hi
>
> I am using an iterative method and I want to add a stopping criterion in which the iterating will stop when there is no change in 3 consecutive iterations. I did the following but I am getting syntax error but I am not sure whether the use of BREAK it's correct. My code is as follows:
>
> COUNTER = 0
> IF ABS(OLD_VALUE-NEW_VALUE) EQ 0 THEN COUNTER = COUNTER + 1 $
> ELSE COUNTER = 0
>
> IF COUNTER EQ 3 THEN
> BREAK
> ENDIF

IDL is line oriented. You can extend lines with $ like you did in the first part of your code.

This statement:
> IF COUNTER EQ 3 THEN
is a syntax error.

This statement:
> IF COUNTER EQ 3 THEN BREAK
is not a syntax error. Nor is this,
> IF COUNTER EQ 3 THEN $
> BREAK

Craig
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: triangulation tribulation: alpha shape for raster-to-vector shape extraction (sort of a concave hull)
Next Topic: Sun symbol appears in plot window but not in pdf output

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

Current Time: Fri Oct 10 11:46:56 PDT 2025

Total time taken to generate the page: 0.00627 seconds