On Wed, Jan 24, 2018 at 12:11 PM, mbsoftwaresolutions@mbsoftwaresolutions.com wrote:
I vaguely recall somebody saying timers in VFP were bad (at some point). Was
Timers are like chainsaws. Not too bad, as long as you know which end to hold onto.
Is your plan to run the app in perpetuity, syncing data, or does this just run occasionally? A regular VFP app has the tendency to accumulate cruft over time, and VFP (and Windows) are best restarted daily.
I've seen problems with Timers (and even apps launched from the Windows Scheduler) where something keeps the app from completing, say a slow network connection or errant modal dialog, and the applications will stack up. If a resource is locked exclusively, later launches of the app get stuck. If the slowdown is suddenly released, you can have the unintended effect of multiple invocations trying to complete at the same time, leading to duplication, stack faults or crashes.
Windows Scheduler has facilities built in to terminate an application if it doesn't complete in a specified time range. With VFP, that might be tricky to duplicate: turn off the timer to avoid duplicates, and set a watchdog timer to CLEAR ALL, CLOSE ALL, RELEASE ALL, QUIT might do it. But then the timer is off: you'd likely want to signal that with a lock on a DBF, as the lock would clear when the app was closed.
See? Multithreaded asynchronous coding is simple!