Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Waiting for lock
Message
From
19/03/1997 21:52:50
 
 
To
19/03/1997 19:34:28
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00024916
Message ID:
00024944
Views:
45
>
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform