Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Shorter than sys(2015)
Message
From
04/02/2015 15:24:21
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., New Zealand
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Web
Miscellaneous
Thread ID:
01614860
Message ID:
01614891
Views:
100
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.
"... They ne'er cared for us
yet: suffer us to famish, and their store-houses
crammed with grain; make edicts for usury, to
support usurers; repeal daily any wholesome act
established against the rich, and provide more
piercing statutes daily, to chain up and restrain
the poor. If the wars eat us not up, they will; and
there's all the love they bear us.
"
-- Shakespeare: Coriolanus, Act 1, scene 1
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform