Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Generation of sequential number
Message
From
08/08/2002 11:52:05
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00687333
Message ID:
00687580
Views:
14
Thanks for the response Rodolfo - I'm am going to look at both yours and Michel solutions to the problem.

Gaylen

>Gaylen
>
>Try it:
>
>Create Table MyCounter (TableName C (10), NextNo N (5))
>* Testing...
>For x = 100 To 150
>   ? Next_Id("ORDERS")
>EndFor
>Return .T.
>
>Procedure Next_Id
>LParameters m.TableName
>Update MyCounter Set NextNo = NextNo+1 Where TableName = m.TableName
>If _Tally = 0
>   Insert Into MyCounter (TableName, NextNo) Values (m.TableName, m.NextNo)
>EndIf
>Select NextNo From MyCounter Where TableName = m.TableName Into Cursor Result
>Return Result.NextNo
>
>
>Enjoy...! :)
>
>I made this code right now, so maybe there are some errors here... Nothing hard to correct, ok?
>
>[]s
Previous
Reply
Map
View

Click here to load this message in the networking platform