>>>Hi everybody,
>>>
>>>I see that we're using sys(3) in one place which may return non-unique numbers. Does sys(2015) have the same problem?
>>>
>>>Say, I see this comment in Help
>>>
>>>Remarks
>>>Use SYS(2015) to create unique names for items such as procedures, functions, files, tables or cursors. You can add a prefix or change the length of the name using the SUBSTR( ) function. For example, the code "tmp"+SUBSTR(SYS(2015),4,3) returns tmpCIOS.
>>>
>>>The name that SYS(2015) returns is created from the system date and system time. Calling SYS(2015) more than once during the same millisecond interval
returns a unique character string.
>>>
>>>So, can I 100% trust sys(2015)?
>>>
>>>Thanks in advance.
>>
>>Tried the following code:
>>
>>
lbPass = .T.
>>lcLast = ""
>>FOR lnTry = 1 TO 100000
>> lcNow = SUBSTR(SYS(2015),3,10)
>> IF m.lcLast==m.lcNow THEN
>> ? "Fail at "+TRANSFORM(m.lnTry)+" try."
>> lbPass = .F.
>> ENDIF
>> lcLast = m.lcNow
>>ENDFOR
>>IF m.lbPass THEN
>> ? "Passed"
>>END
>>
>>it displayed "Passed"
>
>If instead of sys(2015) the sys(3) is used and generates problems in Citrix environment on the
>copy memo .. to (lcFile)
>
>command
>
>do you think switching to sys(2015) will work?
As far as I recall, it only guarantees uniqueness within a particular VFP instance. Instances running simultaneously may likely return the same result for SYS(2015). You could probably prefix the value with something like session ID.