-
DictionaryBase
Originally made a collection class inheriting system.collections.generic.dictionary(of integer,myObject)
when looping through the objects of the collection, they were in exactly the same order as added.
I then realised I should of probably been using inherit system.collections.dictionarybase
looping through the objects this time gave me a different order than when they were added.
I am confused as to why the difference, hoping someone maybe able to explain. :confused:
-
Re: DictionaryBase
The order of items in a dictionary is not relevant. Dictionary items are retrieved by their key. The .NET Framework provides the SortedList, Generic.SortedList and Generic.SortedDictionary classes if order is important. You should read the help topics for each of those classes.
-
Re: DictionaryBase
I already read the help on all of those.
However, that wasn't the question. :)