>>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.