TRIGGER BREAK [ HP Business BASIC/XL Reference Manual ] MPE/iX 5.0 Documentation
HP Business BASIC/XL Reference Manual
TRIGGER BREAK
The TRIGGER BREAK statement allows you to manually cause a Report Writer
break to take place. This results in the printing of the TRAILER and
HEADER sections.
The TRIGGER BREAK statement can not occur within a report description.
Syntax
TRIGGER BREAK break_level
Parameters
break_level A numeric expression in the range zero to nine. A level
of zero has no effect. Other values cause a break to
take place at the given level.
Examples
100 TRIGGER BREAK 5
100 IF Old_data <> New_data THEN TRIGGER BREAK N
The TRIGGER BREAK statement generates an error if a report is not active.
If report output has not started, this statement starts the report,
followed immediately by the break.
The break_level is evaluated after starting the report if this is
necessary. Then all BREAK statements are evaluated in order to determine
the new values for OLDCV and OLDCV$. Then the break actually occurs.
Executing a Report Writer Break
The execution of a summary level break involves several steps. Each step
can execute several different sections of the report. The processing of
the break is described below, in the order in which actions are taken.
A break can be caused either by DETAIL LINE, when a BREAK IF or BREAK
WHEN condition is satisfied, or by the TRIGGER BREAK statement. In
either case, the Report Writer function LASTBREAK is set to the lowest
break that occurred.
1. Execute TRAILER sections from level nine down to the level
contained by LASTBREAK. Each section first executes the TRAILER
statement. The WITH clause is evaluated, and if the number of
lines left on the page is less than the WITH value, a page break
is automatically triggered. If the USING clause is present, it is
then executed. Then the lines in the section are executed. The
WITH clause accounts for all PRINT output generated by the
section.
2. Update the OLDCV and OLDCV$ values. These values are not
recalculated; the values found during the DETAIL LINE or TRIGGER
BREAK are stored until this point, at which time the values are
put into the OLDCV area. All OLDCV values from levels LASTBREAK
to nine are updated.
3. Zero all TOTALS expressions from level LASTBREAK to nine.
4. Set NUMDETAIL to zero for levels LASTBREAK to nine.
5. Update NUMBREAK for levels LASTBREAK to nine. Also, the total
number of breaks [NUMBREAK(0)] is incremented.
6. Finally, all HEADER sections are executed from LASTBREAK to nine.
Each section first executes the HEADER statement. The WITH clause
is evaluated, and if the number of lines left on the page is less
than the WITH value, a page break is automatically triggered. If
the USING clause is present, it is then executed. Then the lines
in the section are executed. The WITH clause accounts for all
PRINT output generated by the section.
Errors during a section can cause the break to stop early. However, most
errors do not cause this to happen. Having fewer lines left on the page
than the WITH value automatically triggers a page break.
MPE/iX 5.0 Documentation