Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating a part number
Message
De
30/01/1997 15:20:45
 
 
À
30/01/1997 15:15:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00018858
Message ID:
00018874
Vues:
42
>I am a little bit green in some areas. This is only my 2ed application :-) On the first one is was a geographic location that the user supplied. Any suggestions? thanks for your patients

Try something like this

* Get the next unique key
LOCAL lcAlias,lnOldRec,lnDernier,lnSelect
lcAlias=ALIAS()
lnSelect=SELECT()
SELECT TABLE
lnOldRec=SAVEREC()
SEEK lcAlias ORDER ALIAS
lnDernier=0
DO WHILE NOT RLOCK()
ENDDO
REPLACE CLE WITH CLE+1
UNLOCK
lnDernier=CLE
RESTREC(lnOldRec)
SELECT (lnSelect)
RETURN lnDernier

You may want to create TABLE.DBF, which contains the tables used in your application. At least, one field, CLE, is used to keep the current last unique id.
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