Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How often is SYS(2015) changed?
Message
From
07/09/2011 08:38:41
 
 
To
07/09/2011 06:51:16
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01521892
Message ID:
01522886
Views:
67
>>Probably better to PADR() or PADL() with 0's than use a format string that injects spaces. That just looks weird. :-)
>>
>>I think I'd use
>>
>>
>>lcId = SYS(2015) + PADL(Application.ThreadId,5,"0")
>>
>>
>>Actually I think you might need 6 characters - I frequently get 5 digit values in the upper 5 digit range. In theory threadID is a DWORD so that number COULD get VERY large. In reality though I've never seen a 6 digit threadID - anyone?
>>
>>+++ Rick ---
>>
>>><snip>
>>>>
>>>>lcId = SYS(2015)+TRANS(Application.ThreadId)
>>>>
>>>>
>>>>Unfortunately this also changes the size of the id and because the value isn't a fixed length it's harder to optmize the id. ThreadIds can be up to 5 digits wide.
>>>>
>>>
>>>You can easily make it a fixed length.
>>>
>>>
>>>lcId = SYS(2015) + TRANSFORM(Application.ThreadId, "@L 99999")
>>>
>
>
>I'm sorry.
>
>That is a very excellent idea...
>But I prefer to use hexadecimal value that will always result 4 bytes length.
>
>
>m.lcNewID = SYS(2015) + RIGHT(TRANSFROM(Application.ThreadId, "@0"), 4)
>
>
>What do you think, sir?
>
>
>Regards,
>Onytoo

You are only creating the name of a variable, so the difference will be zero.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform