Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Generation of sequential number
Message
De
08/08/2002 04:36:12
 
 
À
07/08/2002 21:15:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00687333
Message ID:
00687412
Vues:
13
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform