主题:大家帮忙看看这段代码吧
procedure TForm1.BitBtn2Click(Sender: TObject);
var
Dim:Variant;
copyArray:array[0..5,0..5] of Variant;
i,j :integer;
aa:OleVariant;
begin
//Dim copyArray(1 To 5, 1 To 5) As Variant;
//Dim copyArray(1..5) As Variant;
//F1Book1.CopyDataToArray( 1, 1, 1, 5, 5, False, copyArray
for i:=0 to 5 do
begin
for j:=0 to 5 do
begin
copyarray[i][j]:=random(10);
end;
end;
//aa:= copyarray;
VtChart1.CopyDataToArray(1,1,5,5,copyArray);
VtChart1.DataGrid.RowCount = 5 ;
VtChart1.DataGrid.ColumnCount = 5 ;
VtChart1.CopyDataFromArray 1, 1, 5, 5, copyArray);
end;
VtChart1.CopyDataToArray(1,1,5,5,copyArray);
这一句报错 说OleVariant 和 Array 类型矛盾
var
Dim:Variant;
copyArray:array[0..5,0..5] of Variant;
i,j :integer;
aa:OleVariant;
begin
//Dim copyArray(1 To 5, 1 To 5) As Variant;
//Dim copyArray(1..5) As Variant;
//F1Book1.CopyDataToArray( 1, 1, 1, 5, 5, False, copyArray
for i:=0 to 5 do
begin
for j:=0 to 5 do
begin
copyarray[i][j]:=random(10);
end;
end;
//aa:= copyarray;
VtChart1.CopyDataToArray(1,1,5,5,copyArray);
VtChart1.DataGrid.RowCount = 5 ;
VtChart1.DataGrid.ColumnCount = 5 ;
VtChart1.CopyDataFromArray 1, 1, 5, 5, copyArray);
end;
VtChart1.CopyDataToArray(1,1,5,5,copyArray);
这一句报错 说OleVariant 和 Array 类型矛盾