Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
COUNT taking too long on network
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
COUNT taking too long on network
Miscellaneous
Thread ID:
00172498
Message ID:
00172498
Views:
77
Hi all,

I have a function where I have 2 FOR...ENDFOR loops where the counter is ALEN(myArray).

As I go thru each array, I set my filter to match the active values of the arrays. Then I use the COUNT command with the FOR clause as a third filter. However this seems to take forever on the network. Would it be faster to set the whole filter within the COUNT statement?

EX.

This is what I have now:

for i = 1 to alen(MyArray1)
for j = 1 to alen(MyArray2)
sele myAlias
set filter to myField1=MyArray1[i] and myField2=MyArray2[j]
go top
count for myField3 = '1' to myVar1
count for myField3 = '2' to myVar2
.
.
.
count for myField3 = 'n' to MyVarn
endfor
endfor

Could this work better and faster:

for i = 1 to alen(MyArray1)
for j = 1 to alen(MyArray2)
sele myAlias
go top
count for myField1=MyArray1[i] and myField2=MyArray2[j]
and myField3 = '1' to myVar1
count for myField1=MyArray1[i] and myField2=MyArray2[j]
and myField3 = '2' to myVar2
.
.
.
count for myField1=MyArray1[i] and myField2=MyArray2[j]
and myField3 = 'n' to MyVarn
endfor
endfor

I appreciate any thoughts.

TIA
Perry E. Chrzanowski
Programmer/Analyst
Saturn (Solutions) Inc.
Next
Reply
Map
View

Click here to load this message in the networking platform