Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Generation of sequential number
Message
De
08/08/2002 11:48:39
 
 
À
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:
00687577
Vues:
13
Thanks Michel - Just what I was looking for.
Gaylen



>>I need to generate a sequential number to add to applications as they are entered into a table. The applications will be keyed by a number of key punchers and I need a method to create the sequential number and populate the records as they are added to the table. Waiting for VFP8 is not an option although I understand it will do it natively.
>
>We have this approach to query our Table.dbf table for the next ID:
>
>
>* Get the next id
>* expC1 Name of the table in TABLE.DBF
>FUNCTION GetNumero
>PARAMETER tcTable
>LOCAL lnOldSel,lnCompteur
>lnOldSel=SELECT()
>lnCompteur=0
>SELECT TABLE
>SEEK UPPER(PADR(tcTable,8,' ')) ORDER TAG TABLE
>DO WHILE (NOT RLOCK()) AND (INKEY(0.1)=0) AND lnCompteur<=25
>   lnCompteur=lnCompteur+1
>ENDDO
>REPLACE NUMERO WITH NUMERO+1
>UNLOCK
>SELECT(lnOldSel)
>RETURN TABLE.NUMERO
>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform