REPORT EXIT [ HP Business BASIC/XL Reference Manual ] MPE/iX 5.0 Documentation
HP Business BASIC/XL Reference Manual
REPORT EXIT
The REPORT EXIT statement defines a Report Writer section that executes
when the STOP REPORT statement executes in a program. This condition
typically indicates than an error has been detected and that the report
must be stopped abnormally. The REPORT EXIT section allows the program
to produce a meaningful message and finish the report gracefully. If no
WITH or USING clause is present, the statement produces no output.
Syntax
[ [LINES]]
REPORT EXIT boolean_expr [WITH num_lines [LINE ]]
[USING image [; output_list]]
Parameters
boolean_expr If this expression is zero (FALSE), the REPORT EXIT
section does not execute. For nonzero values (TRUE),
the REPORT EXIT statement and section will execute.
This provides you with more control over early report
termination.
num_lines The maximum number of lines expected to be needed by the
section statement. This number reflects ALL output done
by the section.
image An image string or a line reference to an IMAGE line.
output-list A list of output items, identical to the list used by
the PRINT USING statement.
Examples
The following examples show the use of the REPORT EXIT statement.
100 REPORT EXIT TRUE
100 REPORT EXIT Implementor > 0 WITH 3 LINES USING Rpt_image
The REPORT EXIT statement generates an error if no report is active.
If a report section is active (executing) and encounters this statement,
then that report section is ended.
The REPORT EXIT section executes ONLY when STOP REPORT is executed in a
program. A STOP REPORT command stops the report immediately. When STOP
REPORT is executed, the REPORT EXIT section evaluates the Boolean
condition first. If the result is FALSE (zero), control returns to the
STOP REPORT statement. If the result is TRUE (nonzero), the REPORT EXIT
statement and section are executed. A page eject is always done, whether
or not this statement is executed.
The REPORT EXIT section is executed even if report output has not
started.
NOTE It is recommended that you include a TRIGGER PAGE BREAK at the
beginning of the REPORT EXIT section. This ensures that there are
enough lines left on the page to print the message, and provides a
last page of the report that is dedicated completely to the REPORT
EXIT output.
MPE/iX 5.0 Documentation