Click here to Skip to main content
16,006,845 members
Home / Discussions / C#
   

C#

 
AnswerRe: Mixing console and GUI app issue Pin
Strahan2017-Sep-09 4:00
Strahan2017-Sep-09 4:00 
Questionc# Regex Help Pin
will kirkby30-Aug-09 12:05
will kirkby30-Aug-09 12:05 
AnswerRe: c# Regex Help Pin
Not Active30-Aug-09 15:18
mentorNot Active30-Aug-09 15:18 
AnswerRe: c# Regex Help Pin
Mikey_H30-Aug-09 16:27
Mikey_H30-Aug-09 16:27 
AnswerRe: c# Regex Help [modified] Pin
PIEBALDconsult30-Aug-09 16:45
mvePIEBALDconsult30-Aug-09 16:45 
Question[solved] Proper way to sort a List<> Custom objects Pin
Dwayner7930-Aug-09 10:37
Dwayner7930-Aug-09 10:37 
AnswerRe: Proper way to sort a List<> Custom objects Pin
Henry Minute30-Aug-09 10:42
Henry Minute30-Aug-09 10:42 
AnswerRe: Proper way to sort a List<> Custom objects Pin
DaveyM6930-Aug-09 11:08
professionalDaveyM6930-Aug-09 11:08 
If you always want to sort on one field (i.e. address) then implement IComparable<T>
It's really simple:
struct MYSTRUCT : IComparable<MYSTRUCT>
{
    public double address;
    public short datLen;
    public string data;

    public int CompareTo(MYSTRUCT other)
    {
        return address.CompareTo(other.address);
    }
}
Now just call Sort on your collection and it will automatically use your CompareTo method.

Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
Why are you using VB6? Do you hate yourself? (Christian Graus)

AnswerRe: Proper way to sort a List&lt;&gt; Custom objects Pin
Luc Pattyn30-Aug-09 11:13
sitebuilderLuc Pattyn30-Aug-09 11:13 
AnswerRe: Proper way to sort a List&lt;&gt; Custom objects Pin
Luc Pattyn30-Aug-09 12:06
sitebuilderLuc Pattyn30-Aug-09 12:06 
GeneralRe: Proper way to sort a List&lt;&gt; Custom objects Pin
Dwayner7930-Aug-09 15:41
Dwayner7930-Aug-09 15:41 
QuestionC# List problem Pin
Charlesh330-Aug-09 9:50
Charlesh330-Aug-09 9:50 
AnswerRe: C# List problem Pin
Luc Pattyn30-Aug-09 10:25
sitebuilderLuc Pattyn30-Aug-09 10:25 
GeneralRe: C# List problem Pin
Charlesh330-Aug-09 12:37
Charlesh330-Aug-09 12:37 
GeneralRe: C# List problem Pin
Luc Pattyn30-Aug-09 12:44
sitebuilderLuc Pattyn30-Aug-09 12:44 
AnswerRe: C# List problem Pin
OriginalGriff30-Aug-09 21:27
mveOriginalGriff30-Aug-09 21:27 
GeneralRe: C# List problem Pin
Charlesh331-Aug-09 17:26
Charlesh331-Aug-09 17:26 
GeneralRe: C# List problem Pin
OriginalGriff31-Aug-09 21:36
mveOriginalGriff31-Aug-09 21:36 
Questionfinding .resx fallback culture thru code [modified] Pin
yanairon30-Aug-09 6:00
yanairon30-Aug-09 6:00 
Question[Answered] Creating a list/collection containing different object types [modified] Pin
Trollslayer30-Aug-09 5:24
mentorTrollslayer30-Aug-09 5:24 
AnswerRe: Creating a list/collection containing different object types Pin
PIEBALDconsult30-Aug-09 5:34
mvePIEBALDconsult30-Aug-09 5:34 
GeneralRe: Creating a list/collection containing different object types Pin
Trollslayer30-Aug-09 6:16
mentorTrollslayer30-Aug-09 6:16 
GeneralRe: Creating a list/collection containing different object types Pin
Luc Pattyn30-Aug-09 6:29
sitebuilderLuc Pattyn30-Aug-09 6:29 
GeneralRe: Creating a list/collection containing different object types Pin
Trollslayer30-Aug-09 6:54
mentorTrollslayer30-Aug-09 6:54 
GeneralRe: Creating a list/collection containing different object types Pin
Luc Pattyn30-Aug-09 10:26
sitebuilderLuc Pattyn30-Aug-09 10:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.