Board index » cppbuilder » BCB3 missing implementation of: TStringList -> CustomSort( )
Oren (Halvani.de)
![]() CBuilder Developer |
BCB3 missing implementation of: TStringList -> CustomSort( )2003-11-04 02:59:43 AM cppbuilder101 hi dear builders, I got one problem, Remy gave me a nice piece of code the handles a sorting-routine.. the problem is, that I use BCB 3 Pro. and there isn't an implementation of ->CustomSort( ) can someone tell me if there is an implementation of CustomSort ( ) or maybe something similar to it for BCB 3 ??? Thanks for any help... Oren /**********************************************************/ int __fastcall SortCallback(TStringList *List, int Index1, int Index2) { AnsiString Name1 = (StrRScan(List->Strings[Index1].c_str(), ';') +1); AnsiString Name2 = (StrRScan(List->Strings[Index2].c_str(), ';') + 1); return AnsiCompareStr(Name1, Name2); } void __fastcall TFormular::Button1Click(TObject *Sender) { TStringList *sList = new TStringList; try { sList->AddStrings(Memo1->Lines); sList->CustomSort(SortCallback); Memo1->Lines->Assign(sList); } __finally{delete sList;} } /**********************************************************/ |