Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Random Account Generator
Message
 
To
30/04/1997 07:53:42
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00030217
Message ID:
00030230
Views:
35
>>Does anyone have a snippet of code that will generate a random, yet unique id of the form
>>
>>A######, where A=any alpha and #=digit
>
>I think SYS(2) will return a unique id.

No, Sys(2) returns the seconds elapsed since midnight...
Your best bet for uniqueness is to implement a counter for both the letter and the number part. If you use randomness there is no guarantee of uniqueness.
Peter Stephens
Visual Records, Inc.

Lead Programmer for the general purpose record keeping system Visual Records. Written primarily in VFP 6.0 with a little C++.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform