>>In any case, only assign the number when the record is saved.
>>
>>If you need code for getting a sequence from a sequence table, I can search for mine.
>
>Hilmar,
>
>I've changed my mind - I better add default values and counters table, so I would appreciate the code.
>
>Thanks.
It is very old code, actually (may look unelegant):
PROCEDURE gettablecounter
PARAMETER cTablename
LOCAL nCounter
IF seek(cTablename,'counters','tablename')=.f.
RETURN 0
ENDIF
IF rlock('counters')=.f.
RETURN 0
ENDIF
nCounter=counters.counter+1
REPLACE counter with nCounter in counters
UNLOCK in counters
RETURN nCounter
ENDPROC
Edward Pikman
Independent Consultant