i ask how use multiple break in for each
statement.
sample:
car code color code 0001 002 0001 002 0001 001 0005 003 0005 002 0007 001 0008 001 0008 005 0008 001
my code is:
def var ctr int.
for each car no-lock break carcode colorcode.
ctr = ctr + 1. /*i tried*/ if last-of(carcode) , last-of(colorcode) do: disp carcode colorcode ctr. ctr = 0. end. /*and tried*/ last-of(colorcode) do: if last-of(carcode) disp carcode colorcode ctr. ctr = 0. end. end. end.
my expected output be:
car code color code qty 0001 001 1 0001 002 2 0005 002 1 0005 003 1 0007 001 1 0008 001 2 0008 005 1
try this:
for each tablename no-lock break carcode colorcode: ctr = ctr + 1. if last-of(carcode) or last-of(colorcode) do: disp carcode colorcode ctr. ctr = 0. end. end.
it possible last-of(colorcode) true , last-of(carcode) false, change , or.
if last-of(carcode) true, last-of(colorcode) true.
Comments
Post a Comment