Display Questions

nate100

Member
Hello,
I have the following:


def var i as int.
def stream strma.

output to abc.txt.

for each so_mstr where so_domain = 'us1' no-lock:
display so_nbr with stream strma.
i = i + 1.
export so_nbr.
if i > 5 then leave.
end.
output close.

How do I also display the value of so_nbr on the screen as the program is processing it. I need to use STREAM but not sure how to do so.

Thank you.
 
Hello,
I have the following:


def var i as int.
def stream strma.

output to abc.txt.

for each so_mstr where so_domain = 'us1' no-lock:
display so_nbr with stream strma.
i = i + 1.
export so_nbr.
if i > 5 then leave.
end.
output close.

How do I also display the value of so_nbr on the screen as the program is processing it. I need to use STREAM but not sure how to do so.

Thank you.

If you do not use stream Progress will write to the default output stream which is normally a terminal. Since you have already defined a named stream to write the output to a file you can still use the default stream to write to your screen. In your program it means that if you remove the stream from your display statement the ie "display so_nbr." it will write the value of so_nbr to screen. If you add stream name to export ie "export stream strma so_nbr" the export statement will write the value of so_nbr to file.

The above means that you will have to change the program to this :

Code:
def var i as int.
def stream strma.
 
output stream strma to abc.txt.
 
for each so_mstr where so_domain = 'us1' no-lock:
display so_nbr.
i = i + 1.
export stream sttma so_nbr.
if i > 5 then leave.
end.
output stream strma close.
 
Back
Top