Break By and Next

sebouh181

New Member
I have a FOR EACH with BREAK BY I just want to know if I uses a NEXT statement in this FOR EACH will it effect the order of the break knowing that I'm using NEXT statement after checking a field that is used in the BREAK.

For example: FOR EACH T-TEMP BREAK BY T-ID
BY T-Type
BY T-SEQ:
IF T-TYPE = "A" THEN NEXT.
FIRST-OF(....)

LAST-OF(.....)
END.

Thanks in advance
 

WillieG

New Member
Hi,
I would say no it will not effect the order of the break. Your example should work fine, but be careful if you use IF FIRST(....) & IF LAST(....), because the record after the NEXT statement could in some instances not be the FIRST / LAST record.
If you use FIRST(...) / LAST(...) statements get rid of your NEXT statement by including it in a WHERE clause.
Like in your example:
for each t-temp WHERE t-type NE "A" break by t-id
by t-type
by t-seq:
IF FIRST(...)
IF FIRST-OF(...)
IF LAST-OF(...)
IF LAST(...)
END.
 

sebouh181

New Member
Hey thanks! I can't get rid of the NEXT cause i have a really complicated conditions!! I must use the next. I just wanted to be sure that it will not effect the order.
Thanks
 
Top