I have a problem with my program. Looking around the posts here I have some ideas, but nothing solid in my mind yet.
I have a function that is continously scanning a folder for new file additions. When it finds one it converts the file, moves it and waits for another.
Obviously, just the scanning of the directory is eating up a hell of a lot of CPU cycles continously so I wanted to check the directory every 2, 4 or 6 seconds, which ever works best.
The sleep lib (kernel32) solutions sounds OK but I was wondering if anyone had examples of this kind of "putting the the breaks on" in a continously running function.
Here's an snippit of my code:
While Complete <> "OK"
findFile = Dir(strFile + "*.doc"
<i>...if found do conversion & save file elsewhere...</i>
'Move original file out of scanned folder
FileCopy "E:\PDF\inbox\" + findFile, "E:\PDF\outbox\" + findFile
Kill "E:\PDF\inbox\" + findFile
Wend
Thanks. Jace Hayman
jace@swig-online.co.uk
I have a function that is continously scanning a folder for new file additions. When it finds one it converts the file, moves it and waits for another.
Obviously, just the scanning of the directory is eating up a hell of a lot of CPU cycles continously so I wanted to check the directory every 2, 4 or 6 seconds, which ever works best.
The sleep lib (kernel32) solutions sounds OK but I was wondering if anyone had examples of this kind of "putting the the breaks on" in a continously running function.
Here's an snippit of my code:
While Complete <> "OK"
findFile = Dir(strFile + "*.doc"
<i>...if found do conversion & save file elsewhere...</i>
'Move original file out of scanned folder
FileCopy "E:\PDF\inbox\" + findFile, "E:\PDF\outbox\" + findFile
Kill "E:\PDF\inbox\" + findFile
Wend
Thanks. Jace Hayman
jace@swig-online.co.uk