* Get the next id * expC1 Name of the table in TABLE.DBF FUNCTION GetNumero PARAMETER tcTable LOCAL lnOldSel,lnCompteur,lnNumero,lnLen,lcTable,lnOldRec lnOldSel=SELECT() lnCompteur=0 SELECT TABLE lnOldRec=SaveRec() lnLen=LEN(Table) lcTable=PADR(tcTable,lnLen,' ') SEEK UPPER(lcTable) ORDER TAG TABLE DO WHILE (NOT RLOCK()) AND (INKEY(0.1)=0) AND lnCompteur<=25 lnCompteur=lnCompteur+1 ENDDO REPLACE ID WITH ID+1 UNLOCK lnNumero=ID RestRec(lnOldRec) SELECT(lnOldSel) RETURN lnNumero