Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Generation of sequential number
Message
From
08/08/2002 11:48:39
 
 
To
07/08/2002 21:15:05
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00687333
Message ID:
00687577
Views:
12
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
>
Previous
Reply
Map
View

Click here to load this message in the networking platform