function select( s : integer; var r : RecordArray;
lo, up : integer ) : typekey;
var i, j : integer;
tempr : ArrayEntry;
begin
s := s+lo-1;
if (sup) then Error {*** selection out of bounds ***}
else begin
while (up>=s) and (s>=lo) do begin
i := lo;
j := up;
tempr := r[s]; r[s] := r[lo]; r[lo] := tempr;
{*** split file in two ***}
while i tempr.k do
j := j-1;
r[i] := r[j];
while (i |