Read from text file that is being changed
Posted on 2004-09-22
I want to read from a text file that is being changed.
There is a program that writes to a text file. The text file is being updated almost every other second.
I want in my program to read from the text-file and place every line in an array, this has to be done pretty quick.
I was thinking to have a loop ,so every second, there is a command that reads from the text file. Preferably to read the last 10 lines from the text-file. Compare those lines to the the lines from the previous "read" and then write the lines that are new to an array.
Then display the last line in a text-field, that is being every other second.
Is this a good way?
Im having problems with:
reading from just the last 10 lines in the file
To run the loop just once every second. (the form never shows up when I try to run my program, since it seems busy with the loop...)
thanks in advance!