I want to sort the arrays uSort+dSort in ascending and descending order. So far I've only succeeded in populating them. Any thoughts on how to sort them?
var: ui(0), di(0);
array: uRoc[9999,0](0), dRoc[9999,0](0), uSort[0](0), dSort[0](0);
if ui>=4 then begin {populate uSort}
uSort[0]=uRoc[ui,0];
uSort[1]=uRoc[ui-1,0];
uSort[2]=uRoc[ui-2,0];
uSort[3]=uRoc[ui-3,0];
end;
if di>=4 then begin {populate dSort}
dSort[0]=dRoc[ui,0];
dSort[1]=dRoc[ui-1,0];
dSort[2]=dRoc[ui-2,0];
dSort[3]=dRoc[ui-3,0];
end;