Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Code only runs correctly in debug mode
Message
 
À
02/08/1998 11:17:07
Larry Long
ProgRes (Programming Resources)
Georgie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00123317
Message ID:
00123407
Vues:
19
>Jim,
>Are you sure that two consecutive calls to SYS(2015) can return the same value? By the definition in the help, SYS(2015) returns unique values, even if the "clock" is in the same "tick".
>Help text snippet-
>"Calling SYS(2015) more than once during the same millisecond interval will return a unique character string."
>
>Have you actually seen the duplication happen? If so, I am going to have to re-code my keyfield generation routines!
>//:^o

Larry,

I don't trust anything that is automatically supposed to return unique values. I use a primary key table with one record for each table in the databse. It has a integer field then all I need to do is look up the table, lock the record, increment the value in field, unlock the record and return the new value.

It is possible that sys(2015) could return the same value to two different machines. The guarantee is only that on any one machine it will not return the same value.

SYS(3) will even return the same value on one machine under certain codnitions. I just don't see any reason why I shoudl have code that might fail whne code that doesn't fail is so easy to write.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform