Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure DescendingSort(GenStrGrid: TStringGrid);
- var
- iii: Integer;
- jjj: Integer;
- rrr: Integer;
- xxx: Integer;
- yyy: Integer;
- begin
- yyy := GenStrGrid.FixedRows;
- rrr := GenStrGrid.RowCount;
- xxx := rrr - yyy;
- GenStrGrid.RowCount := rrr + xxx;
- //copy ke baris bawah (baris bantuan) dengan urutan terbalik;
- jjj := GenStrGrid.RowCount - 1;
- for iii := yyy to rrr - 1 do
- begin
- GenStrGrid.Rows[jjj] := GenStrGrid.Rows[iii];
- dec(jjj);
- end;
- //kembalikan ke atas yg sudah kebalik;
- jjj := rrr;
- for iii := yyy to rrr - 1 do
- begin
- GenStrGrid.Rows[iii] := GenStrGrid.Rows[jjj];
- inc(jjj);
- end;
- //hapus baris bantuan;
- GenStrGrid.RowCount := rrr;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement