Re: Invert an Arraylist.Sort()
- From: "Derek Martin" <dmj2195@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 6 Apr 2005 13:40:25 -0500
Ooooh - good idea!!!! Thanks Russell...
Derek
"Russell Jones" <arj1@xxxxxxxxxxxxxxxxxxxxx> wrote in message
news:uSInuXtOFHA.1176@xxxxxxxxxxxxxxxxxxxxxxx
> Call Sort, and then ArrayList.Reverse.
>
> "Derek Martin" <dmj2195@xxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:%23NGbTRtOFHA.3928@xxxxxxxxxxxxxxxxxxxxxxx
>> Hi List, I have an arraylist of objects. I have created my own
>> IComparable in the object to return the sort on datetime. This works
>> great! Now, I'd like to invert the sort. Currently, it gives me 4/1/05
>> before 4/5/05 (good), but I'd like to have 4/5/05 before 4/1/05 (better!)
>> for my application.
>>
>> Public Function CompareTo(ByVal obj As Object) As Integer Implements + _
>> System.IComparable.CompareTo
>> If TypeOf obj Is glcobject Then
>> Dim tmp As glcobject = DirectCast(obj, glcobject)
>> Return m_datetime.CompareTo(tmp.m_datetime)
>> End If
>> End Function
>>
>> ???
>>
>> Thanks!
>> Derek
>>
>
>
.
- Follow-Ups:
- Re: Invert an Arraylist.Sort()
- From: Dennis
- Re: Invert an Arraylist.Sort()
- References:
- Invert an Arraylist.Sort()
- From: Derek Martin
- Re: Invert an Arraylist.Sort()
- From: Russell Jones
- Invert an Arraylist.Sort()
- Prev by Date: Passing objects ByVal vs ByRef
- Next by Date: Re: Passing objects ByVal vs ByRef
- Previous by thread: Re: Invert an Arraylist.Sort()
- Next by thread: Re: Invert an Arraylist.Sort()
- Index(es):
Relevant Pages
|