>CLOSE all >use aliq excl >*index on no tag no >*set order to "no" >for i = 1 to 20 && assume 20 values for flag > * seek i &&Table has no index order set > LOCATE FOR no=i && this is what i add > copy next 5 to temp while no = i >use aliq1 **** This closes Aliq and opens aliq1 **** > append from temp >use aliq excl **** This USES Aliq BUT it does not establish an index. You should USE aliq EXCL TAG no **** > >next >>thanks,
CLOSE ALL && Bad Idea to close everything, but not the cause of your current problems USE aliq1 SELECT 0 USE aliq EXCL INDEX ON no TAG no FOR i = 1 TO 20 && assume 20 values for flag SEEK i COPY NEXT 5 TO temp WHILE no = i SELECT aliq1 APPEND FROM temp SELECT aliq NEXT