Re: [fpc-pascal] Sorting a Stringlist on ValueFromIndex

2022-02-15 Thread Michael Van Canneyt via fpc-pascal
On Tue, 15 Feb 2022, James Richters wrote: Thanks for the elegant solution Michael, but I'm having some issues implementing it. I'm getting: pastep.pas(28651,10) Warning: Function result does not seem to be set 28650 // Custom compare function 28651 function CompareValues(List: TStringLi

Re: [fpc-pascal] Sorting a Stringlist on ValueFromIndex

2022-02-15 Thread James Richters via fpc-pascal
Thanks for the elegant solution Michael, but I'm having some issues implementing it. I'm getting: pastep.pas(28651,10) Warning: Function result does not seem to be set 28650 // Custom compare function 28651 function CompareValues(List: TStringList; Index1, Index2: Integer): Integer; 28652

Re: [fpc-pascal] Sorting a Stringlist on ValueFromIndex

2022-02-14 Thread Michael Van Canneyt via fpc-pascal
On Mon, 14 Feb 2022, James Richters via fpc-pascal wrote: Is there a quick way to sort a stringlist on it's .ValueFromIndex field instead of it's .Names field? // Custom compare function function CompareValues(List: TStringList; Index1, Index2: Integer): Integer; begin Result:=Compar