On Dec 30, 2004, at 12:48 PM, Charles Yeomans wrote:
On Dec 30, 2004, at 2:39 PM, Jason Essington wrote:
On Dec 30, 2004, at 12:28 PM, Charles Yeomans wrote:
On Dec 30, 2004, at 2:18 PM, Jason Essington wrote:
how hard is it to just subclass dictionary something like:
Right now it's pretty hard; I don't think that methods of intrinsic
classes can be overridden.
Funny, that was exported source from a little test class that I made
to do just that. It appeared to work just fine for me (RB 5.5.4).
my test case looked something like:
dim d As new StringKeyDictionary()
d.value("abc") = "lowercase"
d.value("aBc") = "mixed case"
d.value("ABC") = "uppercase"
MsgBox "abc "+d.value("abc")
MsgBox "aBc "+d.value("aBc")
MsgBox "ABC "+d.value("ABC")
d.value(34) = "number" // throws exception
MsgBox "34 "+d.value(34) // would also throw exception
Appearances can be deceiving -- try changing the first line above to
dim d as Dictionary
and see what happens.
yup, that causes RB to fail to follow class hierarchy . . . which is a
bug in my opinion.
never the less if you define the variable as a StringKeyDictionary it
works as expected.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|