I have VFP6.0,VFP5.0 and FoxPro2.5 DOS on my Dell 266Mh laptop. I wanted to see the speed difference between these 3 products. The code I ran is as below:
set talk off
w='This is a substring of a string'
x=seconds()
newstr=''
for i=1 to 100000
m=newstr+substr(w,1,3)
next
y=seconds()
?y - x
a=seconds()
for i=1 to 1000000
i=i+1
next
b=seconds()
?b-a
m=seconds()
use trans in 0 && approx 21000 records and 6 cdx indexes
reindex
n=seconds()
?n-m
The results were somewhat disappointing. The 1993 DOS product is the fastest and VFP6.0 is the slowest. I ran the program 3 times in each version. The results are:
VFP6.0
.585 .565 .559
1.469 1.470 1.471
4.879 2.574 2.590
VFP5.0
.679 .626 .625
1.241 1.234 1.232
2.821 2.584 2.599
FoxPro2.5 DOS
.489 .489 .489
.954 .954 .958
2.747 2.787 2.786
A problem is a problem only as long as it has a possible solution. Lacking that, it becomes a FACT!