re: Opening file at midnight hangs-up computer
Sunday, October 28, 2007 at 9:39 pm Windows 95 Annoyances Discussion Forum
Posted by Joe Hepperle
(73 messages posted)
Andrzej:
The application has been given a task, but you've provided no ONERR branch. On line
17 you have it set to open and close the text file up to five times unless it sees
the data in the text file which your app is "looking" for. But you have the application
set to look that number of times on TODAYS DATE.
Let's say your app begins just before midnight and goes through 2 loop iterations.
Then midnight strikes. Now it has three more iterations to go. As it passes through
the loop again, it picks up the instruction to check "Five times on todays date".
That is where it is getting stuck, scratching it's head, confused. Should it check
three times (the remaining instruction from before midnight) or five times? It doesn't
quite know what to do and you haven't provided a way "out" for it.
One possible solution is to have it check the TIME NOW and if it is between 11:50pm
and 11:59 pm, GOTO end, do not run. Or you could set the loop to an infinite number
of times, with a hotkey to abort. What I usually do is set the application to start,
but not begin the loop. Instead it stops at the beginning of the loop, waiting for
(keyboard) input. I set my F12 key as the hotkey. Then it sits there, doing nothing,
until I hit the F12 key, at which time it will cycle through the loop ONE time and
return to the top waiting again for (keyboard) input. By doing it this way, it only
cycles when I want it to, and it is independent of any automatic passes through the
loop. Good Luck.
Joe Hepperle
|