Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Argument starter - The roots of all evil
Message
 
To
09/09/2004 08:27:06
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00938079
Message ID:
00940887
Views:
33
>> Even though Tamar has indicated that there's an order of magnitutde difference between using a FOR...ENDFOR construct over a DO WHILE, I don't necessarily believe that it would apply in all cases. While her remarks were directed towards VFP 7.0 and above, in VFP 6.0 it took in excess of 10,000,000 iterations before more than 1/10th of a second was realized. <
>
>FYI, just ran my test code in VFP 6 SP5. Results:
>
>DO WHILE: 14.5370
>FOR: 1.2250
>
>Again, this 10,000 iterations of a loop from 1 to 1,000. So, 10000*1000 = 10,000,000 iterations.
>
Tamar,

Bruce Campbell and I did some work based on his code. That's where the numbers came from. Certainly, under other circumstances, the difference might be greater. Then again, we should always consider the circumstances.

In Bruce's case, using FOR...ENDFOR with an EXIT because the routine was time sensitive and encompassed a huge umber of iterations. There, it was certainly an appropriate choice. However, I don't believe that it applies to all cases.
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform