Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Shorter than sys(2015)
Message
De
05/02/2015 12:12:23
 
 
À
04/02/2015 15:24:21
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., Nouvelle Zélande
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Web
Divers
Thread ID:
01614860
Message ID:
01614927
Vues:
51
>Peter,
>
>Tamar has suggested that sys(2015) is not unique across sessions.
>
>She is correct. *Definitely* there can be duplicates between simultaneous instances on a quick server.
>
>You can get around it using Windows handles (that are unique across all sessions)
>
>
DECLARE INTEGER GetActiveWindow IN user32
>? getactivewindow()
>
>
>Truncating to 5 characters: integer is only 4 (!) , BINTOC() will return 4 chars but includes chr(0) and other characters not suitable for some uses. In the old days before integer dbf fields (remember those days?!) we used an AllowedCharacter algorithm to convert integer to 4 alphanumeric chars. Hex won't work- 5 characters not enough for Windows handle.

But is activewindow() unique across users?? I don't think so.

However, in a multiuser application one might always also incorporate at least a user-specific id in the unique name.

And of course, a key is only unique for a limited number of cases. E.g. a numeric key of, let's say, 5 positions is not enough if there are potentially more that 99.999 cases. But that's a no-brainer, I guess. :)
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform