Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The Mother of Unique IDs
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
The Mother of Unique IDs
Divers
Thread ID:
00009899
Message ID:
00009899
Vues:
96
OK, have my Kevlar on. I decided to create a solid unique ID number generator. The only restriction I used was to stay within the 10 character default field length. The value I came up with, I figure, has an odds of 1 in 2.59 billion chance of being reproduced (duplicated) in Windows & 1 in 259 million chance in NT.

Check it out:

int(seconds() *100000 + day(date()))

The resolution of seconds on an NT machine is 10 thousandths. In 95 an older, 1 thousandths. On a 133 Pentium I held down the CTRL+Y key and added records. Even in the NT setup no 2 records were ever near identical. It ain't perfect but it is getting close.

Tom
Tom
--------------------------------
Tom O'Hare
407-299-4268 -- tom@redtile.com -- http://www.redtile.com/
Independent Programmer Using Visual FoxPro, Visual Basic & more...
Operations Manager -- Virtual FoxPro User Group (VFUG)
http://www.vfug.org/ -- tom@vfug.org
President -- Central Florida FoxPro User Group (CFFUG)
http://www.redtile.com/foxpro/
Universal Thread Most Valued Professional (MVP)
http://www.transformation.com/foxpro/
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform