выводит ошибку Array type Requied в выделенной строке…((((как исправить?
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
Edit7: TEdit;
Edit8: TEdit;
Edit9: TEdit;
Edit11: TEdit;
Edit12: TEdit;
Edit13: TEdit;
Edit14: TEdit;
Edit15: TEdit;
Edit16: TEdit;
Edit17: TEdit;
Edit18: TEdit;
Label1: TLabel;
Label2: TLabel;
Edit10: TEdit;
MainMenu1: TMainMenu;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
Edit19: TEdit;
Label3: TLabel;
Edit20: TEdit;
Label4: TLabel;
Edit21: TEdit;
Label5: TLabel;
procedure N2Click(Sender: TObject);
procedure N3Click(Sender: TObject);
procedure N4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
type
Matrix=class
a:array[1..3,1..3]of real;
constructor create(x1,x2,x3,x4,x5,x6,x7,x8,x9:integer);
procedure Umnogenie(k:integer);
procedure vyvod;
procedure Delenie(d:integer);
procedure vvod;
procedure Stepen(r:integer;a:array of integer);
end;
var
i,j:integer;
Form1: TForm1;
Tmatrix:matrix;
x1,x2,x3,x4,x5,x6,x7,x8,x9:integer;
implementation
{$R *.dfm}
constructor matrix.create;
begin inherited create;
a[1,1]:=x1;
a[1,2]:=x2;
a[1,3]:=x3;
a[2,1]:=x4;
a[2,2]:=x5;
a[2,3]:=x6;
a[3,1]:=x7;
a[3,2]:=x8;
a[3,3]:=x9;
end;
procedure matrix.vvod;
begin
x1:=strtoint(form1.edit1.text);
x2:=strtoint(form1.edit2.text);
x3:=strtoint(form1.edit3.text);
x4:=strtoint(form1.edit4.text);
x5:=strtoint(form1.edit5.text);
x6:=strtoint(form1.edit6.text);
x7:=strtoint(form1.edit7.text);
x8:=strtoint(form1.edit8.text);
x9:=strtoint(form1.edit9.text);
end;
procedure matrix.vyvod;
begin
form1.edit10.text:=floattostr(a[1,1]);
form1.edit11.text:=floattostr(a[1,2]);
form1.edit12.text:=floattostr(a[1,3]);
form1.edit13.text:=floattostr(a[2,1]);
form1.edit14.text:=floattostr(a[2,2]);
form1.edit15.text:=floattostr(a[2,3]);
form1.edit16.text:=floattostr(a[3,1]);
form1.edit17.text:=floattostr(a[3,2]);
form1.edit18.text:=floattostr(a[3,3]);
end;
procedure matrix.Umnogenie;
begin
for i:=1 to 3 do
for j:=1 to 3 do
a[i,j]:=a[i,j]*k;
end;
procedure matrix.Delenie;
begin
for i:=1 to 3 do
for j:=1 to 3 do
a[i,j]:=a[i,j]/d;
end;
procedure matrix.Stepen;
begin
for i := 1 to 3 do begin
for j := 1 to 3 do begin
a[i,j]:=0;
end;end;
begin
for r := 1 to 3 do
a[i,j]:= a[i,j]+a[i,r]*a[r,j];
end;
end;
procedure TForm1.N2Click(Sender: TObject);
var
k:integer;
begin
k:=strtoint(form1.edit19.text);
Tmatrix.vvod;
Tmatrix:=matrix.create(x1,x2,x3,x4,x5,x6,x7,x8,x9);
Tmatrix.Umnogenie(k);
Tmatrix.Vyvod;
end;
procedure TForm1.N3Click(Sender: TObject);
var
d:integer;
begin
d:=strtoint(form1.edit20.text);
Tmatrix.vvod;
Tmatrix:=matrix.create(x1,x2,x3,x4,x5,x6,x7,x8,x9);
Tmatrix.Delenie(d);
Tmatrix.Vyvod;
end;
procedure TForm1.N4Click(Sender: TObject);
var
r:integer;
begin
r:=strtoint(form1.edit21.text);
Tmatrix.vvod;
Tmatrix:=matrix.create(x1,x2,x3,x4,x5,x6,x7,x8,x9);
Tmatrix.Stepen(r,a);
Tmatrix.Vyvod;
end;
end.