>Sys(3) is suitable for a random filename - filenames are not created in con
>secutive milliseconds. For keys, no.
>
>Do you have a suggestion?
>
I can only repeat what you can find in numerous threads on the
matter here - either use a separate table to keep the last values of
PK's for each table, using mechanism like the NewID procedure in the
TasTrade example, or use a combination of stationID+datetime().
There's a function which gives a string based on milliseconds,
sys(2015) or something near to it.
I've used this (the ib is internal key field; in this case it was
used for synchronizing two records in master and subdirectory
tables, i.e. it had to be unique)
repl ib with subs(sys(2015),2)
* and a stupid empty loop until the next millisecond
do while sys(2015)="_"+ib
endd
In your case it would be this IB preceded with stationID. It's based
on an assumption that one machine may generate this key only once -
and we can wait until the millisecond's end to make sure it's
unique.