coming out of a for each loop if a condition is met....

Posted by Admin on 16-Mar-2009 23:28

Hi..I am quite new to Progress development. I am trying to find a match to a condition within a for loop, and if that condition is met, then I don't want the for-each loop to go to the next iteration/to continue, but end there completely. What I have got is below:

any help would be really great.....thanks....

All Replies

Posted by Admin on 17-Mar-2009 00:13

if api-idate

then leave.

Posted by Admin on 17-Mar-2009 00:15


Posted by Admin on 17-Mar-2009 00:24


Posted by Admin on 17-Mar-2009 00:25

what about if i want to come out of 2 loops...1 main loop and 1 nested this as below:

for each wo-order where woo-project = tt-screen.joq-project no-lock:

for each ap-item where api-voucher = woo-order no-lock:

if api-idate

then do:

/* show error msg */





Posted by Admin on 17-Mar-2009 00:29

You use block-labels fcor that purpose:

Posted by Admin on 18-Mar-2009 00:18

You might also want to check the NEXT statement. That does not leave the whole loop. It just leaves the current iteration and starts with the next one.

This thread is closed