Hello, First, thanks a lot for the rtl-generics units, this really was a great contribution to the Free Pascal community!
So, sometimes, I need to sort the values of a specialized key/value list, but I can't compile the adapted Delphi XE code below (I'm using MODE DELPHI): === begin code === var key: string; ordkeys: TArray<string>; list: TDictionary<string, string>; begin list := TDictionary<string, string>.Create; try list.Add('a', 'aaa'); list.Add('b', 'bbb'); list.Add('c', 'ccc'); ordkeys := list.Keys.ToArray; TArray.Sort<string>(ordkeys); for key in ordkeys do WriteLn(key, ' - ', list[key]); finally list.Free; end; end. === end code === I got: 'Error: Identifier not found "TArray"' So I've fixed it with: === begin code === ... {$IFDEF FPC} TArrayHelper<string>.Sort(ordkeys); {$ELSE} TArray.Sort<string>(ordkeys); {$ENDIF} ... === end code === So, is this the best way to solve this problem? Thank you! P.S.: You should remove the {$H+} from the generics.* units, the mode Delphi already enables the long strings <http://www.freepascal.org/docs-html/prog/progsu25.html>. -- Silvio Clécio
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal