Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do you lock a record fast?
Message
From
27/02/2003 13:02:08
Walter Meester
HoogkarspelNetherlands
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00758830
Message ID:
00758898
Views:
16
Hi mike,

To ease the pain a little, You can significantly speed up the process with
SET REPROCESS TO 1
=SYS(3051,100)
the SET REPROCESS command force VFP to have only one attempt locking the record. This by default takes 333 miliseconds. You can adjust the duration of the lock interval by issueing SYS(3051,100) to 100 milliseconds. Trying 31 locks then should take 3.1 seconds.

BTW, I don't know whether the SYS(3051) function is available with VFP6 or did come with VFP7.

Walter,



>I’m trying to locate the next available unlocked record in a table.
>The table has about 150 records in it.
>
>When I use following code it may take 30 seconds if the 31 record is next available unlocked record and rLock() will return .T. but it is slow
>
>Sele the table
>scan
> IF rlock() = .t.
> ?rlock()
> endif
>endscan
>
>
>if I use this code it flies thru the isRlock function but will get .f. when it tries rLock()
>
>Sele the table
>scan
> IF isRlock() = .t.
> ?rlock()
> endif
>endscan
>
>What is the fasted way to do this?
Previous
Reply
Map
View

Click here to load this message in the networking platform