Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Generation of sequential number
Message
From
08/08/2002 04:36:12
 
 
To
07/08/2002 21:15:05
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00687333
Message ID:
00687412
Views:
14
Hi,

>>
DO WHILE (NOT RLOCK()) AND (INKEY(0.1)=0) AND lnCompteur<=25
   lnCompteur=lnCompteur+1
ENDDO
REPLACE NUMERO WITH NUMERO+1
UNLOCK
<<

But what if you don't get the lock in 2.5 secs (or maybe less without CLEAR TYPEAHEAD) ? Why not just:
SET REPROCESS TO 3 SECONDS
IF RLOCK() 
  REPLACE NUMERO WITH NUMERO+1
  UNLOCK
  lnNextNumber = NUMERO
ELSE
  lnNextNumber = 0 && Error Condition
ENDIF
* Tidy up
RETURN lnNextNumber
Regards,
Viv
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform