‎2007 Nov 16 12:53 PM
Hi,
I m having a loop in tht i m checking one condition if its satisfied i will continue else my control have to go to next statement.. how to do this..
I tried to use continue but its going to loop statement not to the next statement below if condition ...
Eg.
loop at it.
if a < 50.
b = a + b.
else.
continue.
endif.
a = a / 10.
move a to c.
write c.
endloop.
here if a > 50 means my control has to go to a = a / 10 statement.
when i used continue the control goes to loop at it.
what is the exact keyword to be used.
the requirement is i should not place
<b>a = a / 10.
move a to c.
write c.</b>
in elseif part.
Can anyone guide me..
Thanks in advance.
Maya.
‎2007 Nov 16 12:55 PM
‎2007 Nov 16 1:03 PM
Hi,
try this.
loop at it.
if a < 50.
b = a + b.
else.
a = a / 10.
move a to c.
write c.
endif.
endloop.
Reward if solves your problem.
‎2007 Nov 16 1:07 PM
Hi,
Try this Code
loop at it.
if a < 50.
b = a + b.
else.
a = a / 10.
move a to c.
write c.
endif.
endloop.
Thanks
Yogesh
‎2007 Nov 16 1:21 PM
Hi.
This is the correct code.
loop at it.
if a < 50.
b = a + b.
else.
a = a / 10.
move a to c.
write c.
endif.
endloop.
U have not used ELSE and CONTINUE correctly.
Once the control reaches the <b>Continue</b> keyword will go back to the loop only, it will neglect the remaining statement under the CONTINUE ..
Hope it wll helps
Regards
Bala..
‎2007 Nov 16 1:57 PM
Hi,
why
"the requirement is i should not place
a = a / 10.
move a to c.
write c.
in elseif part"?
Do you need to execute this code ever?
Regards,
Gianpietro Dal Zio
‎2007 Nov 16 2:22 PM
Hi Maya,
if you want to leave the loop then EXIT is the statement to be used.
Regards,
Clemens