Q
qiuxing009
Unregistered / Unconfirmed
GUEST, unregistred user!
代码如下:
请问在主窗体怎么用一个数组 接收 DateHZ函数返回的Result这个数组
......
type
ReSZ=array [1..28,1..21] of Extended;
......
public
Function DateHZ:ReSZ;
......
function HZThread.DateHZ:ReSZ;
var
iloop,i,n:Integer;
ZD:TStringList;
ExcelApp: Variant;
begin
for i := 1 to 28do
begin
for n := 1 to 21do
begin
Result[i,n]:=0;
end;
end;
ZD:=TStringList.Create;
ZD.Add('C');
ZD.Add('D');ZD.Add('E');ZD.Add('F');ZD.Add('G');ZD.Add('H');ZD.Add('I');
ZD.Add('J');ZD.Add('K');ZD.Add('L');ZD.Add('M');ZD.Add('N');ZD.Add('O');
ZD.Add('P');ZD.Add('Q');ZD.Add('R');ZD.Add('S');ZD.Add('T');ZD.Add('U');
ZD.Add('V');ZD.Add('W');ZD.Add('X');
//**************
try
for iloop := 0 to List.Count-1do
begin
ProBar.Position:=0;
ListViewNa.SetFocus;
ListViewNa.Items[iloop].Selected:=True;
OpenTable('select * from TGB_JGBPB where BH0= '+QuotedStr(List.Strings[iloop])+' order by XM0',AQ);
for i := 1 to AQ.RecordCountdo
begin
ProBar.Max:=AQ.RecordCount;
for n := 1 to ZD.Count-1do
begin
Result[i,n]:=Result[i,n]+KToZero(AQ.fieldbyname(ZD.Strings[n]).AsString);//请问在主窗体怎么接收Result个返回值???
end;
ProBar.Position:=i;
AQ.Next;
end;
end;
ZD.Free;
end;
请问在主窗体怎么用一个数组 接收 DateHZ函数返回的Result这个数组
......
type
ReSZ=array [1..28,1..21] of Extended;
......
public
Function DateHZ:ReSZ;
......
function HZThread.DateHZ:ReSZ;
var
iloop,i,n:Integer;
ZD:TStringList;
ExcelApp: Variant;
begin
for i := 1 to 28do
begin
for n := 1 to 21do
begin
Result[i,n]:=0;
end;
end;
ZD:=TStringList.Create;
ZD.Add('C');
ZD.Add('D');ZD.Add('E');ZD.Add('F');ZD.Add('G');ZD.Add('H');ZD.Add('I');
ZD.Add('J');ZD.Add('K');ZD.Add('L');ZD.Add('M');ZD.Add('N');ZD.Add('O');
ZD.Add('P');ZD.Add('Q');ZD.Add('R');ZD.Add('S');ZD.Add('T');ZD.Add('U');
ZD.Add('V');ZD.Add('W');ZD.Add('X');
//**************
try
for iloop := 0 to List.Count-1do
begin
ProBar.Position:=0;
ListViewNa.SetFocus;
ListViewNa.Items[iloop].Selected:=True;
OpenTable('select * from TGB_JGBPB where BH0= '+QuotedStr(List.Strings[iloop])+' order by XM0',AQ);
for i := 1 to AQ.RecordCountdo
begin
ProBar.Max:=AQ.RecordCount;
for n := 1 to ZD.Count-1do
begin
Result[i,n]:=Result[i,n]+KToZero(AQ.fieldbyname(ZD.Strings[n]).AsString);//请问在主窗体怎么接收Result个返回值???
end;
ProBar.Position:=i;
AQ.Next;
end;
end;
ZD.Free;
end;