Высокоуровневые методы информатики и программирования. Сивохин А.В - 93 стр.

UptoLike

70
OutSeries.AddXY(iOut,OutDynArray[iOut],'',clBlue);
MidSeries.Clear;
For iMid:=0 to DynArraySize-1 do
MidSeries.AddXY(iMid,MidValue,'',clGreen);
end;
procedure TOrlovArrayForm.SortButtonClick(Sender: TObject);
var
iCol : Integer;//-для организации цикла по колонкам таблиц;
jRow : Integer;//-для организации цикла по рядам(строкам) таблиц;
begin
For jRow:=1 to InStringGrid.RowCount-1 do
Begin
EndSort := False;
While Not EndSort do
Try
EndSort := True;
For iCol:=1 to InStringGrid.ColCount-2 do
If StrToFloat(InStringGrid.Cells[iCol,jRow])<
StrToFloat(InStringGrid.Cells[iCol+1,jRow])
then
Begin
ExchangeVar := StrToFloat(InStringGrid.Cells[iCol,jRow]);
InStringGrid.Cells[iCol,jRow]:= InStringGrid.Cells[iCol+1,jRow];
InStringGrid.Cells[iCol+1,jRow] := FloatToStr(ExchangeVar);
EndSort := False;
End;
Except
on EConvertError do
ShowMessage('Форматы ввода числовых данных: 23;2,3;6E5;6.7E+6;8.9E-
3;8.8e5 и т.д.');
End;
End;
end;
procedure TOrlovArrayForm.ExitButtonClick(Sender: TObject);
begin
OrlovArrayForm.Close;
end;
procedure TOrlovArrayForm.Button1Click(Sender: TObject);
begin
InStringGrid.Options := InStringGrid.Options + [goEditing];
end;
Initialization
End.//—4. Конец модуля для работы с массивами.
        OutSeries.AddXY(iOut,OutDynArray[iOut],'',clBlue);
       MidSeries.Clear;
       For iMid:=0 to DynArraySize-1 do
        MidSeries.AddXY(iMid,MidValue,'',clGreen);
     end;

      procedure TOrlovArrayForm.SortButtonClick(Sender: TObject);
      var
       iCol : Integer;//-для организации цикла по колонкам таблиц;
       jRow : Integer;//-для организации цикла по рядам(строкам) таблиц;
      begin
       For jRow:=1 to InStringGrid.RowCount-1 do
       Begin
       EndSort := False;
       While Not EndSort do
         Try
          EndSort := True;
          For iCol:=1 to InStringGrid.ColCount-2 do
           If StrToFloat(InStringGrid.Cells[iCol,jRow])<
             StrToFloat(InStringGrid.Cells[iCol+1,jRow])
           then
             Begin
              ExchangeVar := StrToFloat(InStringGrid.Cells[iCol,jRow]);
              InStringGrid.Cells[iCol,jRow]:= InStringGrid.Cells[iCol+1,jRow];
              InStringGrid.Cells[iCol+1,jRow] := FloatToStr(ExchangeVar);
              EndSort := False;
             End;
         Except
          on EConvertError do
          ShowMessage('Форматы ввода числовых данных: 23;2,3;6E5;6.7E+6;8.9E-
3;8.8e5 и т.д.');
         End;
         End;
      end;

     procedure TOrlovArrayForm.ExitButtonClick(Sender: TObject);
     begin
       OrlovArrayForm.Close;
     end;

     procedure TOrlovArrayForm.Button1Click(Sender: TObject);
     begin
      InStringGrid.Options := InStringGrid.Options + [goEditing];
     end;

     Initialization
     End.//—4. Конец модуля для работы с массивами.
70