Canalblog
Editer l'article Suivre ce blog Administration + Créer mon blog
Publicité
La Vache En Liberté
Publicité
Visiteurs
Depuis la création 26 462
Newsletter
Archives
9 août 2019

Tri rapide (quicksort) d'une StringGrid

Var gr1:tstringgrid;


procedure TForm1.Button1Click(Sender: TObject);
var x, y, z:integer;
tmpstr : array[0..100] of string;
begin
  with gr1 do
  begin
    for x:= 1 to rowcount -1 do
    for y := 1 to rowcount-x do
      if strtoint(cells[1, y]) > strtoint(cells[1, y+1]) then
        for z := 0 to colcount-1 do
        begin
            tmpstr[z] := cells[z,y];
            cells[z,y] := cells[z, y+1];
            cells[z, y+1] := tmpstr[z];
         end;
   end;
end;

strtoint
strtofloat
strtodatetime

ansicomparestr
ansicomparetext

àâä = a
éèêë = e
îï =i
ôö = o
ùûü = u

 

Publicité
Publicité
Commentaires
Publicité