Answered Exit a 'For-Each' loop

Stefan

Well-Known Member
or while:

Code:
DEF VAR lok AS LOGICAL NO-UNDO.
 
FOR EACH whatever WHILE lok:
  IF condition THEN
      lok = TRUE.
END.
 

GregTomkins

Active Member
This is awesome code but I get this error ' Unable to understand after -- "EACH whatever"' PLEASE HELP!!!! WHAT DOES IT MEAN ?!?!?!?
 

RealHeavyDude

Well-Known Member
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.
 
Top