Post by Henrik Paludan-MørkPost by Pradeep KumarHi
Can we write enform in which the data comes in real time and continues until we stop . any idea
Kumar
Hi Kumar.
i think you will not have success with this approach. Rather, you might want to look into writing a report program that uses the ctrl-27 faciities to "wake up" when a file is changed. that way, you can continouosly write from the file, even if it is still being written.
//Henrik P
If you are willing to write a non-Enform report program, I believe it is not necessary to utilize the Control 27 feature in such a program to make it work well. A simple approach of delaying a short time when the read of the next record from the input file returns the EOF status code, then trying to read from the input file again should work very well. Making the delay time be some constant value around 0.1 second to 1 second probably would work well, and would be very simple to implement.
If you find that checking for a new input record that frequently when no new data is arriving puts more of a load on the system than you want to accept (I kind of doubt that would be a problem), it is not very much more complicated to make the delay time start as, for example, 0.1 second, and if you get EOF for 5 consecutive read attempts, switch the delay time to a larger value, perhaps 5 seconds or 10 seconds. That should reduce any system load from polling for new input to a completely insignificant level. (If you take the adjustable delay approach, be sure to set the delay time back to the low value whenever you have a read that actually returns a record rather than EOF).
There certainly are use cases where Control 27 is very useful. However, I don't believe this is one of them..