>scan through all dbf files in a folder >deletes the .CDX file >A)select * from "Original" into Table temptable >B)recreates the CDX on temptable >C)Copy To "Original" With Cdx Type Fox2x >D)Use In Select("temptable") >endscan >What is the goal of this routine? To down-version a DBF table to Fox2X format?
CLOSE DATABASES ALL *!* This gives us a common table to use for the example CREATE TABLE TestTable ( ID I ) INDEX ON ID TAG ID USE IN TestTable *!* --------------------------------------------------- LOCAL ai[1], lni, lnTags, lcExpr USE TestTable COPY TO NewTable TYPE FOX2X lnTags = ATAGINFO(ai,"TestTable.cdx",'TestTable') && What tags do we need to recreate? USE NewTable FOR lni = 1 TO lnTags lcExpr = ; "INDEX ON " + ai[lni,3] + " " +; "TAG " + ; LEFT(ai[lni,1],10) &lcExpr NEXT lni USE IN NewTable DELETE FILE TestTable.* RECYCLE COPY FILE NewTable.* TO Products2X.* WITH CDX DELETE FILE NewTable.* RECYCLE