Progress
Language Reference


FIRST-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 first iteration for a new break group, and modifies all three block types.

SYNTAX

FIRST-OF ( break-group ) 

break-group

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

EXAMPLE

This procedure generates a report that lists all the item records grouped by catalog page. When the cat-page value changes, the procedure clears the current list of items and displays items belonging to the new catalog page. The FIRST-OF function uses the value of the cat-page field to determine when that value is different from the value during the last iteration.

r-firstf.p
FOR EACH item BREAK BY Cat-Page:
      IF FIRST-OF(Cat-Page) THEN CLEAR ALL.
      DISPLAY Cat-Page item-num item-name.
END. 

NOTE

When you calculate in a block use the BREAK option to tell Progress to calculate when the value of certain expressions changes. Progress uses default formatting to display the results of these calculations. To control the formatting, use the FIRST-OF function to determine the start of a break group and then change the formatting.

SEE ALSO

DO Statement, FIRST Function, FOR Statement, LAST Function, LAST-OF Function, REPEAT Statement


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