Progress
Language Tutorial
for Windows
Directing Output to Multiple Destinations
Progress 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.
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 TO statement redirects the unnamed stream to the the default printer.
- This OUTPUT TO statement redirects the named stream to output to a file.
- The first DISPLAY statement outputs to the unnamed stream only.
- The second DISPLAY statement outputs to the named stream only.
- This OUTPUT CLOSE statement redirects the default stream back to the screen.
- This OUTPUT CLOSE statement redirects the named stream back to the screen.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |