Consultor Eletrônico



Kbase 18937: 4GL. An Example Using BREAK BY Expression
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/02/2005
Status: Unverified

GOAL:

4GL. An Example Using BREAK BY Expression

FIX:

Programmers may wish to make BREAK BY logic conditional, and so attempt to supply a variable for the expression. Supplying simply the variable name does not produce the desired sort order.

The following sample program demonstrates how a variable can be used within an IF THEN ELSE expression to change the sort order.

DEFINE VARIABLE myvar AS CHARACTER.
ASSIGN myvar = "state".

FOR EACH customer BREAK BY (IF myvar = "state" THEN state ELSE country):
DISPLAY state name country credit-limit
(TOTAL BY (IF myvar = "state" THEN state ELSE country)).
END.


FIX:

References to Written Documentation:

Language Reference Volume 1, BREAK BY expression