I got this error from one of my users. In the code below I am applying
manual record locks, and I would assume that it would protect the code from
another user attempting a header lock but they got a "File is in use" on the
gather memo...
This runs in a high speed environment and I cannot rely on the default
Foxpro locking mechanisms.
Should I apply another test prior to writing the values back to the table,
and what would that test be if rlock() was already succesful?
nLock = 0
do while nLock < 100
if rlock()
nLock = 0
exit
else
sleep(50 + int(rand() * 100))
nLock = nLock + 1
endif
enddo
if nLock = 0
scatter memo name oTrack
* .... do stuff with the variables
* got a "file is in use.." error even though rlock() had been applied.
gather memo name oTrack
Unlock
endif