>>
>>No loop there. One pass.
>
>Okay...I misread the original code...didn't realize he was only processing one header.
>
>>Scan for ... has the same drawback + as it hits a record it should populate the variables first. Append from execution should be faster (especially if no indexes on target).
>>
>
>But SCAN can be Rushmore optimized, or an index order can be set, do a SEEK, and SCAN WHILE. Will APPEND FROM use the index from the source file?
>
>>PS: If VFP8 you might even think of :
>>
>>insert into ... select ... from ...
>>
>
>Yep :)
Steve,
No chance for me to know how VFP team designed that but I trust them :)
Below is a very simple test (very simple in that it can't be a reason to solidly say append from is better) :
Create Cursor myTest1 (myPk i, myVal c(10))
For ix=1 to 1000000
Insert into mytest1 values (ix, Sys(2015))
endfor
Index On myPK tag myPK
AFields(arrNew)
Create Cursor myTest2 from array arrNew
Create Cursor myTest3 from array arrNew
lnStart = Seconds()
Select myTest1
Seek 500000
Scan while myPk < 900000
Scatter memvar
Insert into myTest2 from memvar
EndScan
? Seconds()-lnStart
lnStart = Seconds()
Select myTest3
Append From Dbf('myTest1') for myPK >=500000 and myPK <= 900000
? Seconds()-lnStart
Insert needs more work then append from IMHO (I guess - a little time ago I badly needed to process huge files quickly and directly writing dbf lowlevel was fastest)
Cetin