Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Any way to Test for Exclusivity
Message
De
07/02/2004 17:38:35
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00875208
Message ID:
00875212
Vues:
13

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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform