Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Generation of sequential number
Message
De
07/08/2002 21:15:05
 
 
À
07/08/2002 21:11:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00687333
Message ID:
00687334
Vues:
11
This message has been marked as the solution to the initial question of the thread.
>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
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform