• Post Reply Bookmark Topic Watch Topic
  • New Topic

iterator- finding duplicate keys and adding value  RSS feed

 
Keith Anderson
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have read all over the place that this is a common issue.
Apperently I am pritty Dence.(Stupid)

All I am trying to do is iterate threw my array, find a duplicate, and copy the value so before the value goes into my array I have a total of all of that keys values.


Keys Value
01 45
03 58
09 69
02 42
02 28
09 67
-------------

So it should add up key values for 09 = 136 and 02 = 70

so I would get

Keys Value
01 45
02 70
03 58
09 136

=======================



 
Campbell Ritchie
Marshal
Posts: 56540
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Search the Jata™ Tutorials for "Map". Read through the "Collections" section. One of the "Map" pages has an example in which does something quite similar to what you want.
 
Keith Anderson
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I guess it is my own inability to see the obvious.
I did look through those files. I will do so again.
--
again thank you

Me in a funny farm.. (programming funny farm)

 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!