>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
I never tested speed of skip vs _DbSkip(). Even it might be 100% percent slower (I don't say it's), skipping a 10000 records would be nothing compared to other calculations. VFP math is fast too. If that was a string operation I would say absolutely try FLL. 60000 variables are in scope of VFP. You can create 65000 variables and any array could have 65000 elements as well. When it's FLL you should be carefull for allocation of all those variables which greatly needs calls to VFP memory manager. You can't know which would be better before you try a prototype. If routine needs other table operations other than skip then pure VFP version might be better. Instead of skipping you could even get "nextrecord" with file stream operations in C. You could just write a FLL function for "per record" calculation and do the rest in VFP. Also instead of skipping you could lend all data to C with an array. I cut down a 40+ secs operation to 2+ secs with FLL version in the past but it was all about string operations.
Since this is a "solver" operation even an OLEAutomation to Excel solver might be an option.
Whatever you choose you would need an optimized algorithm.
Cetin