Curious, I would have done: LOOP WHILE READNEXT ID READ RECORD FROM FILE,ID THEN IF ((RECORD<FLD.1> EQ COND1) AND (RECORD<FLD.2> EQ COND2) AND (RECORD<FLD.3> EQ COND3)) THEN RECORD<FLD.4> = 'PROCESSED' END END REPEAT
If I was worried about the IF statement getting too long, then I'd do this: LOOP WHILE READNEXT ID READ RECORD FROM FILE,ID THEN ANS1 = (RECORD<FLD.1> EQ COND1) ANS2 = (RECORD<FLD.2> EQ COND2) ANS3 = (RECORD<FLD.3> EQ COND3) IF (ANS1 AND ANS2 AND ANS3) THEN RECORD<FLD.4> = 'PROCESSED' END END REPEAT While I'm on it, I probably wouldn't do the looping like that either, I'd do this: MORE = @TRUE LOOP READNEXT ID ELSE MORE = @FALSE WHILE (MORE = @TRUE) DO READ RECORD FROM FILE,ID THEN IF ((RECORD<FLD.1> EQ COND1) AND (RECORD<FLD.2> EQ COND2) AND (RECORD<FLD.3> EQ COND3)) THEN RECORD<FLD.4> = 'PROCESSED' END END REPEAT Not that I actually think there's anything wrong with the original way it was done... >I use CONTINUE all the time when processing >records that must meet multiple conditions in a loop. This way my code doesnt >look like 'flying geese'. I will write: > >LOOP WHILE READNEXT ID > READ RECORD >FROM FILE, ID ELSE CONTINUE > IF RECORD<FLD.1> NE COND1 THEN CONTINUE > IF >RECORD<FLD.2> NE COND2 THEN CONTINUE > IF RECORD<FLD.3> NE COND3 THEN >CONTINUE > RECORD<FLD.4> = 'PROCESSED' > WRITE RECORD TO FILE, ID >REPEAT >instead of: > >LOOP WHILE READNEXT ID > READ RECORD FROM FILE,ID THEN > IF >RECORD<FLD.1> EQ COND1 THEN > IF RECORD<FLD.2> EQ COND2 THEN >IF RECORD<FLD.3> EQ COND3 THEN > RECORD<FLD.4> = 'PROCESSED' >WRITE RECORD TO FILE, ID > END > END > END > END >REPEAT Dave Barrett, Lawyers' Professional Indemnity Company ------- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/