Re: Invert an Arraylist.Sort()

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
>>
>
>


.



Relevant Pages

  • Re: sorting variables in a stored procedure
    ... I need to sort those five numbers from the smallest to the ... largest before do the insertion. ... Derek ... >> I have a stored procedure with 5 integer parameters ...
    (microsoft.public.sqlserver.datamining)
  • Re: sight-impaired players
    ... if Derek were asked to sort his cards before ... unthinkable that any bridge player could be so mean- ...
    (rec.games.bridge)
  • Re: Dreks mate uncovered.
    ... > I realise I've only been here a couple of days, but I'm sure I speak for many ... If you have a problem with Derek, ... as I don't want his crap in my box. ... He will never give up becuse that is the sort of flawed mind he has. ...
    (uk.people.disability)
  • Re: Anyone for Wetherspoons Haggis?
    ... Being a Scot I love that sort of thing Derek :-) ... have a two slice boil in the bag version. ... Do you ever have white pudding or mealie pudding with your monce and ...
    (uk.people.silversurfers)
  • Re: Anyone for Wetherspoons Haggis?
    ... Being a Scot I love that sort of thing Derek :-) ... have a two slice boil in the bag version. ... Do you ever have white pudding or mealie pudding with your monce and ...
    (uk.people.silversurfers)