kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12380 Topics: 75 Location: San Jose
|
Posted: Thu Dec 29, 2005 12:23 pm Post subject: |
|
|
euphoria,
LEVEL is a system-defined field provided for control reports. The field is defined as a two-byte binary field. The value in LEVEL indicates the control break level and varies from 0 to 'n + 1' where:
■ LEVEL = 0 when processing detail lines
■ LEVEL = n for total line processing at each control level
■ LEVEL = n + 1, when processing FINAL totals.
BREAK-LEVEL is a system-defined field whose value indicates the highest control break level. The following example illustrates using BREAK-LEVEL to display an appropriate message in a BEFORE-BREAK procedure:
Code: |
REPORT RPT
SEQUENCE REGION BRANCH
CONTROL REGION BRANCH
LINE REGION BRANCH NAME PAY-GROSS
BEFORE-BREAK. PROC
IF LEVEL = 1 . * processing lowest break
IF BREAK-LEVEL = 1 . * only branch is breaking
DISPLAY '*** BRANCH TOTALS'
ELSE-IF BREAK-LEVEL = 2. * region is breaking too
DISPLAY '*** BRANCH AND REGION TOTALS'
ELSE-IF BREAK-LEVEL = 3. * final report totals
DISPLAY '*** BRANCH, REGION, AND FINAL TOTALS'
END-IF
END-IF
END-PROC
|
The BEFORE-BREAK procedure is invoked before summary lines are printed. In the previous example, LEVEL and BREAK-LEVEL fields are used to determine the appropriate message displayed before the summary lines are printed. Testing for LEVEL 1 tells us that the first summary line is going to be printed next (BRANCH totals). When BREAK-LEVEL is 1, only the BRANCH field is breaking. Therefore, we want to display a message stating this. When BREAK-LEVEL is 2, the REGION field is breaking. This causes both BRANCH and REGION summary lines to print. When BREAK-LEVEL is 3, prints BRANCH, REGION, and final summary lines.
Hope this helps....
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|