Hello,
I'm trying to find the best way to count elements of an array. I have any number of occurances of dates, such as mm/dd/yy and I would like to count the seperate occurances so that I can plot them on a chart.
The data I'm currently working with is;
7/6/04
7/6/04
7/6/04
7/5/04
7/5/04
7/5/04
7/10/04
7/11/04
7/15/04
7/15/04
7/22/04
6/3/04
6/3/04
Can anyone provide the best possible way to code this. I'm thinking that a recursion type loop is probably the best. So far all I have is this:
arr = date.items()
j = 0
t = 0
count = 0
For i = 0 to date.count-1
If arr(j) = arr(t) Then
count = count + 1
j = j + 1
End If
carr(i) = count
t = t + 1
Next
Which scrolls through the dates, incrementing the counter. I'm also able to change the code and get the first count, which is 3, but after that I'm lost.
TIA,
JohnCR
I'm trying to find the best way to count elements of an array. I have any number of occurances of dates, such as mm/dd/yy and I would like to count the seperate occurances so that I can plot them on a chart.
The data I'm currently working with is;
7/6/04
7/6/04
7/6/04
7/5/04
7/5/04
7/5/04
7/10/04
7/11/04
7/15/04
7/15/04
7/22/04
6/3/04
6/3/04
Can anyone provide the best possible way to code this. I'm thinking that a recursion type loop is probably the best. So far all I have is this:
arr = date.items()
j = 0
t = 0
count = 0
For i = 0 to date.count-1
If arr(j) = arr(t) Then
count = count + 1
j = j + 1
End If
carr(i) = count
t = t + 1
Next
Which scrolls through the dates, incrementing the counter. I'm also able to change the code and get the first count, which is 3, but after that I'm lost.
TIA,
JohnCR