To define and use a new output stream, WebSpeed provides two statements:
DEFINESTREAM statement — Defines a stream
OUTPUTTO statement with the "WEB" option — Opens and directs the specified stream to your Web server
If you do not specify a stream in the OUTPUT TO statement, WebSpeed uses a default unnamed stream to send your output to the Web.
The following example defines a new stream and directs it to the Web:
FIND FIRST Customer NO-LOCK.
DEFINE STREAM MyStream.
OUTPUT STREAM MyStream TO "WEB".
DISPLAY STREAM MyStream Customer.Name Customer.Phone.
This statement opens the default unnamed stream and directs it to the Web:
FIND FIRST Customer NO-LOCK.
OUTPUT TO "WEB".
DISPLAY Customer.Name Customer.Phone.
Both of these examples use the DISPLAY statement directly, sending its output to the Web. However, in the following example, there is no way to guarantee which will appear first in the Web page, the customer name or the customer address:
FIND FIRST Customer NO-LOCK.
OUTPUT TO "WEB".
DISPLAY Customer.Name Customer.Phone.
DISPLAY {&WEBSTREAM} Customer.Address Customer.City Customer.PostalCode.
For more information on the statements used in these examples, see OpenEdge Development: ABL Reference.