RosettaCodeData/Task/Sort-an-array-of-composite-structures/PascalABC.NET/sort-an-array-of-composite-structures.pas
2024-07-13 15:19:22 -07:00

10 lines
232 B
ObjectPascal

type
Pair = auto class
Name,Value: string;
end;
begin
var a: array of Pair := (new Pair('ZZZ','333'),new Pair('XXX','222'),new Pair('YYY','111'));
a.OrderBy(p -> p.Name).Println;
a.OrderBy(p -> p.Value).Println;
end.