Home > Archive > Clarion > October 2004 > check for new text files periodically
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
check for new text files periodically
|
|
|
| I am trying to write some code that will search certain folder(eg. D:\Incoming\) for new text files periodically(eg. every one minute). If a new text file is found, it will retrieve the data of the file and run a procedure. Can somebody tell me is this possible and if yes, how to do it?
Thanks! | |
|
| lai wrote:
> I am trying to write some code that will search certain folder(eg.
> D:\Incoming\) for new text files periodically(eg. every one minute). If
> a new text file is found, it will retrieve the data of the file and run
> a procedure. Can somebody tell me is this possible and if yes, how to
> do it?
It is possible.
Simply place a timer (Prop:Timer) on your window, and do whatever you
need to on Event:Timer. You can consider letting the timed window start
a new thread to process the data, so that the timer-window can go on. In
some situations (when the things you do on the timer window, can happen
to take longer than the timer-interval), it is best to turn off the
timer (window{Prop:Timer} = 0) while you process the Event:Timer, and
then turn the timer on again, to prevent a Event-queue to build up.
You can use "Directory" to list files in a given location. or "Exists"
to check existens of a file with a known name.
Hope this helps
Kasper
--
Besøg mig på nettet: http://www.kaspershjemmeside.dk
| |
|
| lai wrote:
> I am trying to write some code that will search certain folder(eg.
> D:\Incoming\) for new text files periodically(eg. every one minute). If
> a new text file is found, it will retrieve the data of the file and run
> a procedure. Can somebody tell me is this possible and if yes, how to
> do it?
It is possible.
Simply place a timer (Prop:Timer) on your window, and do whatever you
need to on Event:Timer. You can consider letting the timed window start
a new thread to process the data, so that the timer-window can go on. In
some situations (when the things you do on the timer window, can happen
to take longer than the timer-interval), it is best to turn off the
timer (window{Prop:Timer} = 0) while you process the Event:Timer, and
then turn the timer on again, to prevent a Event-queue to build up.
You can use "Directory" to list files in a given location. or "Exists"
to check existens of a file with a known name.
Hope this helps
Kasper
--
Besøg mig på nettet: http://www.kaspershjemmeside.dk
| |
|
| Thanks. I have got the timer function working. But i got invalid function label for "exists" when i compile the program in clarion 4, the word doesn't turn blue as like other label. What i need is to check the existen of file starting with "ver" and end with file extension "txt", eg. "ver1234.txt". Any idea?
Lai | |
|
| I got invalid function label for "exists" when i compile the program in clarion 4, the word doesn't turn blue as like other label. What i need is to check the existence of file starting with "ver" and end with file extension "txt", eg. "ver1234.txt". And can I use "ver*.txt" for the checking? Any idea?
Lai [/B][/QUOTE] |
|
|
|
|