Progress
Language Reference


LAST-OF Function

Interfaces
OS
SpeedScript
All
All
Yes

Returns a TRUE value if the current iteration of a DO, FOR EACH, or REPEAT . . . BREAK block is the last iteration for a particular value of a break group.

SYNTAX

LAST-OF ( break-group ) 

break-group

The name of a field or expression you named in the block header with the BREAK BY option.

EXAMPLE

This procedure uses LAST-OF to display a single line of information on each cat-page group in the item file, without displaying any individual item data. It produces a report that shows the aggregate value on-hand for each catalog page.

r-lastof.p
FOR EACH item BREAK BY cat-page:
     ACCUMULATE on-hand * price (TOTAL BY cat-page).
     IF LAST-OF(cat-page)
     THEN DISPLAY cat-page (ACCUM TOTAL BY cat-page
                  on-hand * price) LABEL "Value-oh".
END. 

SEE ALSO

FIRST Function, FIRST-OF Function, LAST-OF Function


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095