The VFP9 help for sys(2015) says: Calling SYS(2015) more than once during the same millisecond interval returns a unique character string.
Meaning that the result will still be unique even though you call it more than once in the same millisecond. I ran Paul's code in 3 seconds, which generated 1 million strings and then compared them for duplicates. My observations indicated that the generation took much less time than the comparison, say on the order of 1 second. This would be 1000 calls to sys(2015) per millisecond, and I encountered NO duplicates. Personally, I'd rather use autoincrement, but I still don't see any evidence that sys(2015) generates duplicates. Dan Covill On 08/27/12 17:34, Ken Dibble wrote: > On 8/24/12 7:18 PM, Ken Dibble wrote: >>>> > >> >There are no guarantees in life. But the danger of sys(2015) lies in >>it's >>>> > >> >generation >>>> > >> >based on the timestamp. What are the chances of collision on this >>even not >>>> > >> >concatenating the machine name? >> > >Somewhat high, I believe. System clock ticks <> processor cycles. As I >> > >understand it, in VFP RAND() uses the system clock, and RAND() will >> > >generate the same number over and over and over in a tight loop on a fast >> > >machine, until the system clock ticks over. >> _______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/503c3066.2000...@san.rr.com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.