if i have a generics list with more field for example:
PMyList = record
Field1, Field2, ... FieldN : Integer;
end;
TMyList = List<PMyList>;
For order the list with criteria choose to runtime (for example: field2 then field2, or: field3 then field1 then field2 etc) there is some solution or i need to do a compare construct for all combination possibile of order that i want?
Mine idea was, if record is N field, i have thinked to a array so defined:
MyArray = array [1..n] of Integer;
and assign a progressive value to elements of array that determine criteria of sord for example if MyArray is as:
MyArray = (5, 1, 3, 4, 2)
mean that my list need to be sort first for field5, then for field1, then for field3, then for field4, then for field2. Mine question then is: can i to do it using one only construct compare for my list?
Thanks very much for help.