In Delphi I use this line of code to sort a TDictionary
var sortedDictKeys : TList<string>;
begin
sortedDictKeys := TList<string>.Create(flink.CellInhoud.Keys); //TDictionary
sortedDictKeys.Sort;
end;
I converted my project to lazarus. This is my converted code:
var sortedDictKeys : TStringArray;
begin
sortedDictKeys := TStringArray.Create(flink.CellInhoud.Keys); //TFPGMap
sortedDictKeys.Sort;
end;
flink.CellInhoud is a TFPGMap structure. I want to get all keyvalues to TStringarray, but keys needs a parameter to read. How do I read all keys at once.
TStringArray doesn't sort.
Which option do I need to sort a single line of array in my case?
I don't want to sort TFPGMap, because it not sorting on name, but on pointer.
Lazarus 2.06 / FPC 3.04