G
Guest
I have read that Abstract Data Types such as ArrayList, Queue, SortedList and
HashTable are intended to eventually replace the old VB Collection class.
However, I have yet to find a .NET type which lets you add key/value pairs
and, at the same time, keep the values in the same order in which they were
original added (the way the old collection did). For example, suppose I
inherit a class from DictationaryBase and do something like the following:
mydict as mydictionary = new mydictionary()
for i as integer = 1 to 3
mydict.add(i.tostring, i)
dim de as DictationaryEntry
for each de in mydict
debug.writeline de.value
next
The output is:
2
3
1
How do I set up a .NET collection which would output 1 2 3, the way I want?
Or do I just continue using the "old fashioned" VB Collection?
Dan
HashTable are intended to eventually replace the old VB Collection class.
However, I have yet to find a .NET type which lets you add key/value pairs
and, at the same time, keep the values in the same order in which they were
original added (the way the old collection did). For example, suppose I
inherit a class from DictationaryBase and do something like the following:
mydict as mydictionary = new mydictionary()
for i as integer = 1 to 3
mydict.add(i.tostring, i)
dim de as DictationaryEntry
for each de in mydict
debug.writeline de.value
next
The output is:
2
3
1
How do I set up a .NET collection which would output 1 2 3, the way I want?
Or do I just continue using the "old fashioned" VB Collection?
Dan