Chaps,
The issue i am having is with an array compare..
Until now my vacant grasp of splits and basic arrays has been enough but comparing two variable length arrays against each other has got me a tad stumpt..
'Firstly we have a results string:
ResString="100/1,101/2,104/5,109/3"
'Second String is a count of how many times the values in previous ResStrings have been used
UsedString="100/1#5,101/2#1,"
What i am attempting badley is to compare the ResString value against the UsedString value.
If the values match replace the UsedString record with an updated count value or if no compare was found to create a new UsedString value.
I can see part of the solution but the loop within loop is getting me ..
Split the first string
Code:
SplResString=Split(ResString,",")
Create the first loop
Code:
For x = 0 to ubound(SplResString)
Then i presume i can start the next array within the first (now probably going wrong)
Code:
SplUsedString=Split(UsedString,",")
For y = 0 to ubound(SplUsedString)
Then Add the second split
Code:
ReSplUsedString=Split(SplUsedString(y),"#")
and compare the two values (Sure way off here)
Code:
If SplResString(x) = ReSplUsedString(0) then
'Add to rate
newrate=Int(ReSplUsedString(1)) + 1
SplResString(x)=Replace(SplResString(x),ReSplUsedString(0)&#&ReSplUsedString(1),ReSplUsedString(0)&#&newrate)
If you can see where i am going any direction toward my rambling code would be great.
Cheers
Aspless