求助,二维数组的赋值问题(50分)

  • 主题发起人 主题发起人 cricketXGY
  • 开始时间 开始时间
C

cricketXGY

Unregistered / Unconfirmed
GUEST, unregistred user!
想给一个二维动态数组赋值,结果出现问题,
就是A(ii,jj):=aa[jj];这一行
编译提示出错Missing Operator or semicolon
和incompatabile types:'double'and 'dynamic array';
程序代码如下,求助各位高手了!
var
Form1: TForm1;
aa:array ofdo
uble;
//初始化抗体(1组)
A:array of array ofdo
uble;
//抗体组合(i,j)
i,j:integer;
//i为抗体组合数,j为抗体元素个数
implementation
{$R *.dfm}
procedure TForm1.Button2Click(Sender: TObject);
var StrPath:string;
StrNanme:string;
ii,jj:integer;
//抗体循环次数
begin
i:=10;
j:=6;
if opendialog1.Execute then
begin
StrPath:=ExtractFilePath(OpenDialog1.FileName);
StrNanme:=OpenDialog1.FileName;
end;
ExcelApplication1.Connect;
ExcelApplication1.Workbooks.Open(StrNanme,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,0);
ExcelWorkbook1.ConnectTo(ExcelApplication1.Workbooks[ExcelApplication1.Workbooks.count]);
ExcelWorksheet1.ConnectTo(ExcelWorkbook1.Worksheets[1] as _worksheet);
SetLength(aa,j);
SetLength(A,i,j);
for jj:=1 to jdo
//给系数赋值
begin
aa[jj]:=ExcelWorksheet1.Cells.Item[jj,1];
end;
for ii:=1 to ido
//复制i组抗体
begin
for jj:=1 to jdo
begin
A(ii,jj):=aa[jj];
end;
end;
end;
 
应该是A[ii,jj]吧,大哥
 
贴一段代码你改改.
procedure TFrmGL.SpeedButton13Click(Sender: TObject);
var
XML: Array of Array of string;
i,j,k: integer;
s: string;
begin
setlength(xml,10,75);
memo3.Clear;
k:=0;
for i := 1 to 10do
begin
s:='';
for j := 0 to high(xml[0])do
begin
xml[k,j]:=inttostr(j+75*(i-1));
s:=s+xml[k,j]+' ';
end;
memo3.Lines.Add(s);
inc(k);
end;
end;
 
A[ii,jj]:=aa[jj];
 
郁闷,我说呢,呵呵,谢谢各位
 

Similar threads

S
回复
0
查看
1K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
900
SUNSTONE的Delphi笔记
S
I
回复
0
查看
847
import
I
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
后退
顶部