TASK_LockFile = "MyTable.dbf" Use (TASK_LockFile) In 0 Alias TASK_LockFile Set Reprocess To 1 Seconds If ! fLock ("TASK_LockFile") Wait Window TimeOut 20 "TASK_LockFile already locked" Quit endif Set Reprocess To Automatic Select TASK_LockFile Go Top Replace LF_LockDat with DateTime ()Another program ("Task Central") of the same system, can be run by some end users, at their PCs, so they can check if their "tasks" are running, finished, to fire tasks manually etc, all those tasks will be fired by the "Task Scheduller" (code above) in the Win 2K server.
Use (TASK_TaskTable ) In 0 Alias TASK_TaskTableand the code below, any time it needs to know if the "Task Scheduller" is still running (to know if it can pass "messages" to the "Task Scheduller" etc):
If TaskSchedIsRunning () . . . endif . . . Function TaskSchedIsRunning *-------- ------------------ Local bItIsRunning Set Reprocess To 1 bItIsRunning = ! fLock ("TASK_LockFile") Set Reprocess To Automatic UnLock In TASK_LockFile Return bItIsRunning EndFuncAll this was running ok till this morning when I recompiled "Task Central" with VFP 8 (previous version of the executable was compiled with VFP 6).