Try OpenEdge Now
skip to main content
ABL Reference
ABL Syntax Reference : PAGE statement
 

PAGE statement

Starts a new output page for PAGED output. No action is taken if output is already positioned at the beginning of a page.

Syntax

PAGE [ STREAM stream | STREAM-HANDLE handle ]
STREAM stream
Specifies the name of a stream where output is paged. If you do not name a stream, the AVM uses the unnamed stream.
STREAM-HANDLE handle
Specifies the handle to a stream where output is paged. If handle it is not a valid handle to a stream, the AVM generates a run-time error. Note that stream handles are not valid for the unnamed stream.

Example

This procedure prints a customer report, categorized by state, and starts a new page for each state:
r-page.p
DEFINE VARIABLE laststate AS CHARACTER NO-UNDO.

OUTPUT TO PRINTER.
FOR EACH Customer NO-LOCK BY Customer.State:
IF Customer.State <> laststate THEN DO:
IF laststate <> "" THEN PAGE. laststate = Customer.State.
END.
DISPLAY Customer.CustNum Customer.Name Customer.Address Customer.City Customer.State.
END.

Notes

*If the current output destination is not a paged device (you did not use the PAGED option in the OUTPUT TO statement), the PAGE statement has no effect.
*PAGE has no effect if you are already at the top of a new page.
*If any PAGE-TOP or PAGE-BOTTOM frames are active, they are output prior to the next display.
*For more information on streams and stream handles, see the chapter on alternate I/O sources in OpenEdge Development: Programming Interfaces.

See also

DEFINE STREAM statement, OUTPUT TO statement, Stream object handle