Old Mar 31, 2005 | 01:34 PM
  #1  
Cannon's Avatar
Cannon
Registered User
 
Joined: Jan 2005
Posts: 21
Likes: 0
From: High Desert, Sol Cal
Default Computer Programming Error...trouble counting strings

At work, we use primative programs. We are running FoxPro 2.5. I need to be able to have FoxPro scan a window that contains strings. I need it to count the individiual strings and return the counts for each string.

For example, if my window has:
AAA
AAA
BBB
CCC
CCC
CCC
DDD

.. I need to run a loop (Scan?) that will go through the window with these strings, look at each line, and return something like:

AAA = 2
BBB = 1
CCC = 3
DDD = 1

I am having great trouble. I either get nesting errors as I try to run If/Else statements inside a SCAN command OR I just cannot seem to reset my count to zero at the right time. This is the closest I have been able to get:

AAA = 1
AAA = 2
BBB = 3
CCC = 4
CCC = 5
...etc...

Anyone have any suggestions?

Thanks.

-Jeff
Reply