F fuji36 New Member Apr 16, 2013 #1 I would like to exit a 'for each' loop early if conditions are met, not sure of the syntax.
Stefan Well-Known Member Apr 16, 2013 #3 or while: Code: DEF VAR lok AS LOGICAL NO-UNDO. FOR EACH whatever WHILE lok: IF condition THEN lok = TRUE. END.
or while: Code: DEF VAR lok AS LOGICAL NO-UNDO. FOR EACH whatever WHILE lok: IF condition THEN lok = TRUE. END.
G GregTomkins Active Member Apr 16, 2013 #4 This is awesome code but I get this error ' Unable to understand after -- "EACH whatever"' PLEASE HELP!!!! WHAT DOES IT MEAN ?!?!?!?
This is awesome code but I get this error ' Unable to understand after -- "EACH whatever"' PLEASE HELP!!!! WHAT DOES IT MEAN ?!?!?!?
Stefan Well-Known Member Apr 16, 2013 #5 sorry about the typo - it should have been WHILE and not WHLE (post adjusted)...
RealHeavyDude Well-Known Member Apr 17, 2013 #6 If you want to be more particular about what to leave you can also use block labels. Something like that: Code: MY-BLOCK-LABEL: DO : FOR EACH something: IF condition is met THEN LEAVE MY-BLOCK-LABEL. END. END. That way, if you don't want to just exit a loop you can have more control about what block is left ... Heavy Regards, RealHeavyDude.
If you want to be more particular about what to leave you can also use block labels. Something like that: Code: MY-BLOCK-LABEL: DO : FOR EACH something: IF condition is met THEN LEAVE MY-BLOCK-LABEL. END. END. That way, if you don't want to just exit a loop you can have more control about what block is left ... Heavy Regards, RealHeavyDude.