>Again, even if VFP had this it would not preclude the error checking required on USE EXCLUSIVE. It's the same with locks, the only way to know for sure if you can get a lock is to get it. Anything else simply gives you historical infromation, "If you had tried to lock now you would have succeeded. Disclaimer: this information says nothing about any future attempts to lock."
Understood. Though maybe we could compromise with an ExclusiveUse() function that returns .T. (and "uses file excl") if excl is granted or .F. for any other reason.
If !ExclusiveUse("File")
Use File shared
Else
Use File shared
Endif
I have a shared-access queue of 'currently waiting' items. I used a !deleted() filter, then simply delete the record after the job is processed. It'll drop from the index, and the grid-view (upon refresh) It is acceptable to have even 500 records deleted and 2 waiting because only 20-50 records come in per day. At some point (in the mornings) someone is going to run the app when noone else does. When this happens the environment setup code can grab and pack the file, just for housecleaning's sake, then return the file to shared use.