Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
More RLOCK Stuff
Message
From
17/03/1999 15:57:57
 
 
To
17/03/1999 15:20:48
Ian Matthews
Up & Running Technologies Inc
Chestermere, Alberta, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00198638
Message ID:
00198883
Views:
17
>Hi Jim,
>I am not using TRANSACTION but unfortunately two threads have been running on the issue and I think that after 3 hours and about a million suggestions, the only way to check if a record is being viewed is to create a table track who has what open.
>


Ian- I think that you are really close to snagging this, you just need to get your logic in the right order. If everybody is accessing the tablew through the same interface, then you can enforce RLOCK as a read-only mechanism. Like Jim showed you, you want logic like:

IF RLOCK()
* You got the record, locked it, and you have full access to it.
ELSE
* Somebody else has it, because your lock failed.
ENDIF

When you are done with the record, UNLOCK it, and this will allow the next guy to edit it. Your MULTILOCKS setting will be of importance here, and you will need to decide how many records a user should be able to LOCK at once. Keep in mind that if you issue SET MULTILOCKS at any time while any records are locked, they will all be unlocked.

You have probably already looked into it, but you'll also need to pay attention to SET REPROCESS. The default is 1, meaning that VFP only tries once to lock the record, and then gives up. This is probably what you want, I am only bringing it up in case any of your other code has already set it to 0 or AUTOMATIC. Good Luck.

PS, I forgot to include you in the other response, but look at my response to Nancy regarding ISRLOCKED(). The same goes for ISFLOCKED().
Erik Moore
Clientelligence
Previous
Reply
Map
View

Click here to load this message in the networking platform