Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sys(3) Unique Test
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00746521
Message ID:
00746525
Views:
28
Note that SYS(2015) is unique only on one PC, it is not good enough to use on the network as is. If your cursor names are generated only on the server that should work. If not, you need at least to add some kind of prefix (for example network user ID or machine name). And, considering the 10-character limitation, adding the prefix will decrease the uniqueness of the value generated by SYS(2015). Of course, only GUID guarantees the true uniqueness.

>I'll work with that; I can never remember if Sys(3) or Sys(2015) was "truly unique". I was thinking that both might be based on DateTime but ah, nevermind. I'll try 2015 :)
>
>
>
>
>>Why not use sys(2015) (which according to help will not return duplicate names) instead of sys(3) (which will return duplicate names if executed more than once in the same millisecond)?
>>
>>With sys(2015), you can leave off the underscore which is always the first character and get a 9 character unique name.
>>
>>HTH
>>
>>
>>
>>>I am putting together a heavily-multiuser application, and I want to make sure my central VFP service is using uniquely-named cursors all the time (they live in the same DataSession). Right now I am just naming them "x"+Sys(3).
>>>
>>>Is that random enough? This isn't an app where multiple users have an instance of VFP and are making their own unique cursors, this is a VFP "data server" where a single .dll is taking a lot of SQL from a lot of simultaneous users. I only have 10 chars for a cursor name, so giving the cursors a GUID for a name is out of the question (isn't it?).
>>>
>>>Thanks.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform