Reputation: 81
please can you help me understand the difference between Output To and Output Stream in Progress 4GL, and also what is a Stream? , the Progress documentation pages are not helping much.
Thank you very much.
Upvotes: 1
Views: 1899
Reputation: 14020
A stream is like a file handle. You can have multiple streams open and write to them as needed. You might, for instance, have different streams for data and error logs.
Input and output operations always use a stream. If you do not explicitly create one and name it the default is known as the unnamed stream.
define stream dataStrm.
define stream logStrm.
output stream dataStrm to value ( "mystuff.dat" ).
output stream logStrm to value ( "mystuff.log" ).
put stream logStrm now " start" skip.
put stream dataStrm "xyzzy" skip.
put stream logStrm now " end" skip.
output stream dataStrm close.
output stream logStrm close.
Using the default, unnamed, stream is easy but if your processing is complex or frequently opens and closes the target file or if it involves multiple files it becomes difficult to keep track of what is going on. If you are getting errors about streams or output destinations already having a conflicting use but you are not defining any streams then you would probably benefit from creating and using named streams.
Upvotes: 6