>Hi all,
>
>I am working on a table that has a maximum records of 10,000. However, I need to SKIP through every records and every fields in this table to perform some calculation. The program is kind of like "solver" type (solving for at least 60,000 variables), looking for the best value. The number of iterations is extremely high. Would it be better to write a C fll to perform this? My worry is that calling back to VFP (_DBSkip()) would yield the same speed, eventhough I can expect speed increase in other calculations.
>
>It would be great if someone could propose a better idea.
>
>Regards,
>juan
Juan,
Where is the result of your calculation going ??? I would probably use a set based solution instead of skipping around in the table.
As an example,
************************************************************************
Set Procedure To MyProcedureFile
Select ;
MyRow_ID, ;
MyCalculation1(MyCol1, MyCol2, MyCol3) As Result1, ;
MyCalculation2(MyCol2, MyCol6) As Result2 ;
From MyTable ;
Into Table MyResultTable
************************************************************************
You could also replace the procedure file with a VFP DLL and declare the functions ahead of time. I have used similar methodology over and over again on tables with 250,000 + records and many complex calculations with very acceptable results. It's not the only way, but I'm always in favor of reducing the amount of code required.
Regards,
Jason
Jason Tryon
Senior Systems Analyst / Technical Lead
eBusiness / iPage