Hi again Nadya.
As I said before SYS(2015) won't work for you if you need an integer result.
Here is a simple (and somewhat lazy) function to do the same thing:
FUNCTION unlocalkey
LOCAL lc,lcout
lc=SUBST(SYS(2015),2,9)
lcout=""
FOR i=4 TO 9
lcout=lcout+ALLTRIM(STR(ASC(SUBSTR(lc,i,1)),3,0))
NEXT
RETURN INT(VAL(lcout))
It produces rather long results. The numbers should be unique for the cursor produced, provided the query does not take more than a few minutes to run.
This would not be a good thing to do against a shared table (shared in the sense that multiple people were adding records to it at the same time).
Thanks
Gar W. Lipow