Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do you lock a record fast?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00758830
Message ID:
00758850
Views:
19
The problem is IsRlocked() function.
It does not return the correct value.
It may return a .f. but when rLock() tries to lock it you get a .f..
Record is in use...


>Does...
>
>LOCATE FOR NOT ISRLOCKED() WHILE NOT EOF()
>
>... work for you? By including the WHILE, the LOCATE begins its search at the current record instead of at the first record.
>
>>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
Next
Reply
Map
View

Click here to load this message in the networking platform