Consultor Eletrônico



Kbase P164030: 4GL/ABL: How to display a blank line on the screen after each BREAK BY group?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/04/2010
Status: Unverified

GOAL:

4GL/ABL: How to display a blank line on the screen after each BREAK BY group?

GOAL:

How to output a group tag or field on a line alone when it is the first of a BREAK BY group?

GOAL:

How to use the FIRST-OF function to display only one field of the result set row the beginning of each BREAK BY group?

GOAL:

How to use the LAST-OF function to output a blank line at the end of each BREAK BY group?

FACT(s) (Environment):

All Supported Operating Systems
Progress 9.x
OpenEdge 10.x

FIX:

The following 4GL/ABL procedure, which may be executed against the Sports2000 database, demonstrates how to use the FIRST-OF function to put a field on a line alone at the beginning of each BREAK BY group and how to use the LAST-OF function to output a blank line at the end of each BREAK BY group:

FOR EACH customer BREAK BY SalesRep:
FORM HEADER
"SalesRep" AT 1 "Name" AT 15 "Credit Limit" AT 37
WITH NO-BOX NO-LABELS DOWN STREAM-IO.
IF FIRST-OF (SalesRep) THEN DO:
DISPLAY
Customer.SalesRep AT 1 FORMAT "X(4)".
DOWN 1.
DISPLAY
Customer.Name AT 5 FORMAT "X(30)"
Customer.creditlimit AT 37 FORMAT "->,>>>,>>9".
NEXT.
END.
IF LAST-OF (SalesRep) THEN DO:
DISPLAY
Customer.Name
Customer.creditlimit.
DOWN 1.
NEXT.
END.
DISPLAY
Customer.Name
Customer.creditlimit.
END.