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
Re: BREAK statement [message #91358 is a reply to message #91345] Fri, 03 July 2015 07:07 Go to previous messageGo to previous message
g.nacarts is currently offline  g.nacarts
Messages: 148
Registered: November 2013
Senior Member
Thanks Helder, your example it makes sense but still something confuses me.

I had the following procedure

PRO TEST
while iter_lim_count lt iter_lim do begin
for m=0L,nB-1 do begin
for n=0L,nB-1 do begin
A[m,n]+=X
tmp =
B[m,n] = (tmp - init)/X
A[m,n]-=X
endfor
endfor
while tmp GT init do BEGIN
PRINT,'WHILE LOOP'
beta_test = beta_test*2.
A_test = B - beta_test*B
if beta_test LT 0.5 then return
ENDWHILE
PRINT,'EXIT WHILE LOOP'
A = A_test
iter_lim_count = iter_lim_count+1
endwhile
END

The only thing I've changed is to split the whole procedure into two parts and call them in the TEST pro.

PRO TESTING_A
for m=0L,nB-1 do begin
for n=0L,nB-1 do begin
A[m,n]+=X
tmp =
B[m,n] = (tmp - init)/X
A[m,n]-=X
endfor
endfor
END

PRO TESTING_beta
while tmp GT init do BEGIN
PRINT,'WHILE LOOP'
beta_test = beta_test*2.
A_test = B - beta_test*B
if beta_test LT 0.1 then return
ENDWHILE
PRINT,'EXIT WHILE LOOP'
A = A_test
END


PRO TEST
while iter_lim_count lt iter_lim do begin
TESTING_A
TESTING_beta
iter_lim_count = iter_lim_count+1
endwhile
END

I noticed that in the TESTING_beta pro the 'WHILE LOOP' was printing but the 'EXIT WHILE LOOP' never prints out. I am confused because before that I had everything in one function both 'WHILE LOOP' and 'EXIT WHILE LOOP' are printed out. Why now the 'EXIT WHILE LOOP' does not printed out?
[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 20:06:16 PDT 2025

Total time taken to generate the page: 0.05689 seconds