>>....code after tables have been opened
>>
>>SELECT Table1
>>SCAN
>>REPLACE Field1 WITH FieldValue IN Table1
>> IF SEEK(Field2, "Table2", 2)
>> IF Table2.Field1 = .T.
>> INSERT INTO Table3 blah blah blah.....
>> ENDIF
>> ENDIF
>>ENDSCAN
>>
>>There you go, basically what it is doing.
>>
>>Kev
>
>
>INSERT is definitely the problem because you insert a record at the current record pointer position with each call. That means you rewrite the entire table from the top down each time and as the number of records in the table increases, the amount of time to rewrite the table increases. Use APPEND instead as this will add each new record to the end of the table and save lots and lots of disk I/O.
Actually, that's an INSERT INTO - which adds it at the end, just like APPEND - and it's faster, since you don't need an APPEND with a REPLACE or GATHER.
INSERT
may put it at the current record pointer, but only if there's not an index (and maybe not for other reasons). The command is only there for backward compatibility to pre-VFP versions, anyway.
Insanity: Doing the same thing over and over and expecting different results.