Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WARNING - SYS(2015) BEHAVIOR!!!
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00159053
Message ID:
00159403
Views:
29
>>>>Some of you may remember that the help for the SYS(2015) command suggested that to generate an 8 character temp table name, use the following:
>>>> SUBSTR(SYS(2015),3,10)
>>>>
>>>>Today the 3rd digit of SYS(2015) is a "0" (a zero). If you have based your temp table naming logic on this, it will break because an alias cannot start with a numeral.
>>>>
>>>>The third digit will be 0 until November 11, >> 1999 <<.
>>>>
>>>>If your users are all of a sudden calling you with weird problems, this may be a clue.
>>>Gee :) Taking into account that sys(2015) is generated using datetime, I never used that suggestion (and missed it up till now :) and instead added a char in front of whatever part I get it from sys(2015). A simple 8.3 format by sys(2015) :lcTempFileName = stuff("T"+sys(2015),9,0,".")Cetin
>>
>>That's a good suggestion, Cetin.
>>
>>When I wrote 8.3, I actually meant that 8 unique chars for the "8" side. For a unique 8, it is important to take the right hand side of the return value, because that its the part of the return value that will vary the most. Case in point is the fact that the 3rd/4th position of the return value just became zero and will be for a year (not very unique, huh ;-). Think of it like 5 people with stopwatches with millisecond accuracy all pressing the stop button at the same time. For everyone to have a unique time value with 5 digits, you would want to use seconds and milliseconds, not hours and minutes.
>
>Probably Cetin can improve it taking SYS(2015) value from the back end.

I am in no way attacking Cetin's solution: I wasn't even asking for a solution, I was just clarifying what I had not made clear in my original posting. I agree, you could do the following:
lcTempName = "Z"+SUBSTR(SYS(2015),4,7)
Rick Hodder
MCP Visual Foxpro
C#, VB.NET Developer
Independent Consultant
www.RickHodder.com
MyBlog
Previous
Reply
Map
View

Click here to load this message in the networking platform