ebortoluzzi
Member
- Joined
- Sep 17, 2009
- Messages
- 8
- Programming Experience
- Beginner
Hi all
,
I'm creating a sorted list of the type:
Dim ExtractionList As New SortedList(Of Date, Integer())
Dim Estrazioni(7) As Integer
Dim DataKey As Date
using the
ExtractionList.Add(DataKey, Estrazioni)
I have a sorted list according to the DataKey from the oldest date (1st element) to the latest date (last element), because I did not wrote the IComparer the default IComparer(of Date) as been used.
But what I want is a reverse logic of sorting : from the latest date (1st element) to the oldest date (last element).
So I read that I can define the rule at the creation of the list, using the constructor:
SortedList(Of TKey, TValue) (IComparer(Of TKey))
Here is where I got lost the only example in VB is related to strings:
Dim openWith As New SortedList(Of String, String)( _
StringComparer.CurrentCultureIgnoreCase)
but as a DateComparer does not exist I do not know how to proceed; this comparer stuff is new for me can you help me, by:
1 - writing examples
2 - address to examples
....
thank you
I'm creating a sorted list of the type:
Dim ExtractionList As New SortedList(Of Date, Integer())
Dim Estrazioni(7) As Integer
Dim DataKey As Date
using the
ExtractionList.Add(DataKey, Estrazioni)
I have a sorted list according to the DataKey from the oldest date (1st element) to the latest date (last element), because I did not wrote the IComparer the default IComparer(of Date) as been used.
But what I want is a reverse logic of sorting : from the latest date (1st element) to the oldest date (last element).
So I read that I can define the rule at the creation of the list, using the constructor:
SortedList(Of TKey, TValue) (IComparer(Of TKey))
Here is where I got lost the only example in VB is related to strings:
Dim openWith As New SortedList(Of String, String)( _
StringComparer.CurrentCultureIgnoreCase)
but as a DateComparer does not exist I do not know how to proceed; this comparer stuff is new for me can you help me, by:
1 - writing examples
2 - address to examples
....
thank you