Показать сообщение отдельно
  #1  
Старый 23.06.2019, 11:16
mxkrzh mxkrzh вне форума
Прохожий
 
Регистрация: 25.05.2019
Сообщения: 5
Версия Delphi: RAD Studio 10.3
Репутация: 10
Восклицание Ошибка Not enough actual parameters

При компиляции выдаёт ошибку Not enough actual parameters

Код:
unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
  System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.Grids;

type
  TForm1 = class(TForm)
    StringGrid1: TStringGrid;
    Button1: TButton;
    Label1: TLabel;
    Edit1: TEdit;
    procedure Button1Click(Sender: TObject);
    procedure Linear(StringGrid1: TStringGrid; Edit1: TEdit);
    procedure Parabolic(StringGrid1: TStringGrid; Edit1: TEdit);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}
// =============================================================================

procedure TForm1.Linear(StringGrid1: TStringGrid; Edit1: TEdit);
var
  k: array [1 .. 7] of Integer;
  z, a, b: Integer;
begin
  for z := 1 to 7 do
    a := StrToInt(StringGrid1.Cells[z, 2]);
  b := StrToInt(StringGrid1.Cells[z, 1]);
  k[z] := a div b;
  if (k[1] + k[2] + k[3] + k[4] + k[5] + k[6] + k[7]) / 7 = k[1] then
    Edit1.Text := 'Линейная зависимость';
end;

procedure TForm1.Parabolic(StringGrid1: TStringGrid; Edit1: TEdit);
var
  k: array [1 .. 7] of Integer;
  z, s, a, b: Integer;
begin
  for z := 1 to 7 do
  begin
    a := StrToInt(StringGrid1.Cells[z, 2]);
    k[z] := sqrt(a);
  end;
  for z := 1 to 7 do
  begin
    b := StrToInt(StringGrid1.Cells[z, 1]);
    if k[z] = b then
      s := s + 1
  end;
  if s = 7 then
    Edit1.Text := 'Квадратичная зависимость';
end;

  procedure TForm1.Button1Click(Sender: TObject);
  begin
    TForm1.Linear(StringGrid1: TStringGrid, Edit1: TEdit);
    TForm1.Parabolic(StringGrid1: TStringGrid, Edit1: TEdit);
  end;

end.
Ответить с цитированием