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

Home » Public Forums » archive » BREAK statement
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
BREAK statement [message #91343] Wed, 01 July 2015 08:41 Go to previous message
g.nacarts is currently offline  g.nacarts
Messages: 148
Registered: November 2013
Senior Member
Hi I typed the following:

A = sqrt(Ax^2 + Ay^2)

nozero = where(A ne 0, cnt)
if cnt eq 0 then break

I got the following error:
BREAK must be enclosed within a loop (FOR, WHILE, REPEAT), CASE, or SWITCH statement.

The error is very clear. I am not sure if the following is equivalent

A = sqrt(Ax^2 + Ay^2)

nozero = where(A ne 0, cnt)
if cnt eq 0 then return

Using the return instead of break because that part of code does not enclosed within a loop. If not so, can anyone suggest a statement doing the same thing as BREAK without being enclosed within a loop?
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: function graphic question
Next Topic: plotting a sub field image..

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

Current Time: Wed Oct 08 09:18:35 PDT 2025

Total time taken to generate the page: 0.00445 seconds