Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Random Account Generator
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00030217
Message ID:
00030231
Vues:
49
>>>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.

In my case, it did the job. I only used it, sometimes, to give the form a random name. The user will not fire the same fire twice in the same second so this was good so far. I used 'A'+SYS(2) to create the form name.
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