Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Any way to Test for Exclusivity
Message
From
07/02/2004 17:38:35
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00875208
Message ID:
00875212
Views:
14

I would like to do the following:
If IsThisFileUsedExclusive(MyAlias) = .T.
Do Nothing
Else
Select MyAlias
Set Exclu On
Pack
Set Exclu Off
Endif

Is there any command in VFP8 which does a IsThisFileUsedExclusive ?

Regards,

Gerard


this is like the external lock problem.

The only correct solution is:
try to get exclusive
SELECT 0
#IF VERSION(5)<800
   ON ERROR *
   USE MyAlias EXCLUSIVE
   IF USED() && AND ISEXCLUSIVE()
     PACK
   ENDIF
   USE MyAlias  && RELEASE exclusive
   ON ERROR && restore error handling
#ELSE 
   TRY
     USE MyAlias EXCLUSIVE
     PACK
     USE MyAlias  && RELEASE exclusive
   CATCH
   ENDTRY
#ENDIF
Fabio
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform