> set reprocess to automatic > public _gaerror(1,7) > on error aerror(m._gaerror) > use table1 shared > cursorsetprop('buffering',1) && no buffering > local i > for i = 1 to 1 > m._gaerror = 0 > if rlock('0','table1') ; > then > insert into table1 ; > (field1) values (m.lnValue) > unlock record 0 in table1 > else > if m._gaerror(1,1)=108 ; && If the file is locked by another user try again > then > i = i - 1 && keep trying till succed > endif > endif > next > use in table1 >>
> set multilocks on > set reprocess to 1 && try locking once > sys(3051,500) && try at every 500 miliseconds > sys(3052,1,.t.) && index locking honors reprocess setting > sys(3052,1,.t.) && memo locking honors reprocess setting > public _gaerror(1,7) > on error aerror(m._gaerror) > use table1 shared > cursorsetprop('buffering',3) && optimistic row buffering > insert into table1 ; > (field1) values (m.lnValue) > local i > for i = 1 to 1 > m._gaerror = 0 > if not tableupdate(2,.t.,'table1') and ; > m._gaerror(1,1)=108 ; && If the file is locked by another user try again > then > i = i - 1 && keep trying till succed > endif > next > use in table1 >>