【发布时间】:2013-03-20 04:38:59
【问题描述】:
可以使用名称/值对中的名称在 TStringList 上使用 customSort
我目前正在使用 TStringList 对每个 pos 中的一个值进行排序。我现在需要使用此值添加其他数据,因此我现在使用 TStringList 作为名称/值
我目前的 CompareSort 是:
function StrCmpLogicalW(sz1, sz2: PWideChar): Integer; stdcall;
external 'shlwapi.dll' name 'StrCmpLogicalW';
function MyCompare(List: TStringList; Index1, Index2: Integer): Integer;
begin
Result := StrCmpLogicalW(PWideChar(List[Index1]), PWideChar(List[Index2]));
end;
Usage:
StringList.CustomSort(MyCompare);
有没有办法修改它,使其根据名称值对的名称进行排序?
或者,还有其他方法吗?
【问题讨论】:
标签: delphi delphi-2010