Directing output to multiple destinations
- Last Updated: February 11, 2026
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
ABL lets you specify multiple output destinations in
a single procedure. You can use OUTPUT TO several
times in a single procedure to direct the output to different destinations.
You can also define named streams so you can output to several destinations.
First, you use the DEFINE STREAM statement to create the streams you need.
This is a partial syntax for DEFINE STREAM:
Syntax
|
To output to the stream, you reference it in your output statement
with the keyword STREAM, as shown in the following
example:
|
The notes below describe how the code works:
- When the procedure starts, it has a default unnamed stream that outputs to the screen by default. This statement establishes a second stream that also outputs to the screen by default. Both streams are now available for the life of the procedure.
- This
OUTPUT TOstatement redirects the unnamed stream to the default printer. - This
OUTPUT TOstatement redirects the named stream to output to a file. - The first
DISPLAYstatement outputs to the unnamed stream only. - The second
DISPLAYstatement outputs to the named stream only. - This
OUTPUT CLOSEstatement redirects the default stream back to the screen. - This
OUTPUT CLOSEstatement redirects the named stream back to the screen.