Dictionary Commands
Posted: Mon Nov 03, 2008 7:20 pm
So I was playing around with Cobra's Dictionary class today and I was wondering if there was an easier way to get values from a key instead of having to subscript it? Currently this is what I am doing:
Is there any reason anyone can think of as to why it is doing this? The only thing I can think of is that it is comparing by memory addresses instead of by the fooObject's value
So, I was wondering if there is some kind of .get method or something like that which will take a Foo object as the key and return the list of values.
- Code: Select all
myDictionary = Dictionary<of Foo, List<of List<of Bar>>>()
#This throws a KeyNotFoundException...even though I know for a fact that fooObject IS in the
#dictionary
print myDictionary[fooObject].count
Is there any reason anyone can think of as to why it is doing this? The only thing I can think of is that it is comparing by memory addresses instead of by the fooObject's value
So, I was wondering if there is some kind of .get method or something like that which will take a Foo object as the key and return the list of values.