*----------------- * FUNCTION AutoID * * Function to autoplace incrementing ID number * * It checks SETUP.DBF for TRIM(LEFT(ALIAS(),7))+"ID" * it places the ID in that field in the current record (in cID), * and increments the setup field * *----------------- FUNCTION autoid PRIVATE lcsetupvar, lntempid, lcnewid lcsetupvar = TRIM(LEFT(ALIAS(),7))+"ID" REPLACE cid WITH setup.&lcsetupvar lntempid = VAL(cid) + 1 lcnewid = STR(lntempid,LEN(cid),0) lcnewid = PADL(&lcnewid,LEN(cid),'0') REPLACE setup.&lcsetupvar WITH lcnewid RETURN .T.