Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Waiting for lock
Message
De
19/03/1997 21:52:50
 
 
À
19/03/1997 19:34:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00024916
Message ID:
00024944
Vues:
41
>
>FUNCTION GetNumero
>* Get the next id
>* expC1 Name of the table in TABLE.DBF
>PARAMETER tcTable
>PRIVATE lnOldSel,lnNext
>LOCAL lnCompteur
>lnOldSel=SELECT()
>SELECT TABLE
>LOCATE FOR TABLE=tcTable
>SET REPROCESS TO 2

This means it will try 2 times, not 2 seconds. to be seconds it must have a SECONDS clause.

>FOR lnCompteur=1 TO 10
>   IF RLOCK()
>      EXIT
>   ENDIF
>NEXT

Doesn't look ok to me. What happens if the RLOCK() fails all times? After all, it tries only 20 times. This is very fast and it will fail very easy.
So, the REPLACE will fire the message you said.

>REPLACE NUMERO WITH NUMERO+1
>UNLOCK
>lnNext=NUMERO
>SELECT(lnOldSel)
>RETURN lnNext
>
Vlad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform