HP 3000 Manuals

General Information [ HP Business BASIC/XL Reference Manual ] MPE/iX 5.0 Documentation


HP Business BASIC/XL Reference Manual

General Information 

Be aware of the following item, since it affects various Report Writer
statements:

 *  The report sections (REPORT HEADER, REPORT TRAILER, and REPORT EXIT)
    are at level zero.

Report Writer section statements define the headers and trailers printed
in the report.  These statements are included within the report
description.  A REPORT HEADER section defines the beginning of the report
description and the END REPORT DESCRIPTION statement defines the end of
the report description.  Both of these sections are required, whereas all
other Report Writer sections are optional.

A Report Writer section starts with a section statement.  It ends when
the next section statement occurs in the report description.  The section
can contain any legal HP Business BASIC/XL program statements.  These
statements execute when the section is activated by the Report Writer.

The following are Report Writer section statements:

 *  REPORT HEADER

 *  REPORT TRAILER

 *  PAGE HEADER

 *  PAGE TRAILER

 *  HEADER

 *  TRAILER

 *  REPORT EXIT

 *  END REPORT DESCRIPTION

The WITH and USING clauses, used with the Report Writer section
statements, are described later in this section.

All of the report writer section statements are made BUSY and their
expressions are evaluated when BEGIN REPORT executes, preventing their
modification and deletion.  When the report ends, these section
statements are no longer busy.  That is, these report writer section
statements are busy for the duration of an active report.

WITH and USING Clauses 

The WITH and USING clauses control the automatic page break mechanism and
to aid in the printing of each section.  The WITH and USING clauses can
occur in all of the Report Writer section statements except END REPORT
DESCRIPTION and in the DETAIL LINE statements.  These clauses are both
optional; however if both clauses occur, the WITH clause must appear
first.

The USING clause is an implicit PRINT USING statement.

                        [LINES]
Syntax.  WITH num_lines [LINE ]

USING image [; output_list]

Parameters. 

num_lines        The maximum number of lines the section statement
                 expects to need.  This can be any non-negative integer,
                 including zero.  This number reflects ALL output done by
                 the section.  For DETAIL LINE, all lines printed between
                 any two detail lines is included.

image            An image string or a line reference to an IMAGE line to
                 control printing.

output-list      A list of output items, identical to the list used by
                 the PRINT USING statement.

Examples.  The following are examples of the WITH and USING clauses:

     100 REPORT HEADER WITH 3 LINES
     110 DETAIL LINE USING 100;A, B
     120 PAGE TRAILER WITH 2 LINES USING Pt;PAGENUM, DATE$

Whenever a section becomes active, the first action executed is the
section statement.  The WITH clause is evaluated first.  If the number of
lines left on the page is smaller than the WITH value, an automatic page
break results.  Otherwise, the WITH clause has no effect.

The WITH clause ensures that a certain number of lines are available
before the page trailer prints.  If this condition is not satisfied, the
page break ensures that enough lines are available.  If a WITH clause is
not present, the default is one.

The USING clause executes after the WITH clause.  This clause is similar
to a PRINT USING statement in the report section statement.  See PRINT
USING for more details.

If an error occurs during evaluation of the WITH clause, such as a
negative number of lines specified, the USING clause does not execute.
If the USING clause encounters an error, it stops printing.  In either
case, however, the rest of the report section executes.  That is, if
there is an error in the WITH clause, the USING clause will not execute,
but the rest of the section will execute.

Exceptional Cases.  The WITH clauses of the PAGE HEADER and PAGE TRAILER
sections are exceptional.  Instead of evaluating the WITH clause at each
page break, the Report Writer evaluates the PAGE HEADER and PAGE TRAILER
size only when BEGIN REPORT executes.  This action allows the Report
Writer to define the number of lines normally available for printing.
The maximum size of the page header and the size of the page trailer are
fixed throughout the report.  Refer to the PAGE HEADER and PAGE TRAILER
statements for more details.

The USING clauses of the PAGE HEADER and PAGE TRAILER sections are
evaluated each time there is a page break.



MPE/iX 5.0 Documentation