Answered Valid Stream

whwar9739

Member
Good afternoon fellow Progress Programmers:

I have stumbled in to a situation where I would like to check the status of or validity of a defined stream. There are cases where the stream is getting used but has already been closed. Basically I would like to do something similar to VALID-HANDLE() but for a stream.

Thanks everyone.
 

TomBascom

Curmudgeon
That is to make sure that the trigger code you provide doesn't get changed by someone else.

You would enable this if your trigger Does Something Very Important That Ought Not Be Messed With. If your triggers are of no special consequence (like those in sports2000) then you would not take such steps.
 

whwar9739

Member
That is to make sure that the trigger code you provide doesn't get changed by someone else.

You would enable this if your trigger Does Something Very Important That Ought Not Be Messed With. If your triggers are of no special consequence (like those in sports2000) then you would not take such steps.


Tom I think you meant to post this in a different thread.
 

RealHeavyDude

Well-Known Member
You could get the handle to the stream and set the private-data attribute on the handle yourself everytime you open or close the stream accordingly. At least that's what I came up with some time ago. It's neither nice nor elegant but I didn't find any other way:

Code:
assign myHandle = stream myStream:handle.
/* Some stuff */
output stream myStream to value ( myFile ).
assign myHandle:private-data = 'open'.
/* Some stuff */
output stream myStream close.
assign myHandle:private-data = 'close'.
Coded in Internet Explorer 9 IDE - therefore no syntax check but you should get the idea.

Heavy Regards, RealHeavyDude.
 

KrisM

Member
Question is, do you have access to make changes to the source code where this stream is opened and closed ?
 

whwar9739

Member
Thanks RealHeavyDude! I had thought about that.
Yes KrisM I do have access to change the source code.
TheMadDBA, that sounds about perfect for what I need. I'll give it a try.
 

RealHeavyDude

Well-Known Member
The seek ( ) is the much smarter solution. Didn't use it yet once in my ABL ( 4GL ) life though.

Heavy Regards, RealHeavyDude.
 

Cecil

19+ years progress programming and still learning.
I thought using the seek method has always been the standard method to test if a steam was open or closed. It was one of the first tips I learnt when developing printed reports to a serial dot-matrix printer on SCO UNIX on Progress V6.

I wish I could get my hands on those black glossy manuals because I sure it's documented in one of them as an example.
 
Top