不懂你的意思,随便写的,不保证正确,供参考var DWArray : Array of String; SLArray : Array of Integer; with DataSet do begin Close; SQL.Clear; SQL.Add(..) Open; First; if RecordCount > 0 then begin SetLength(DWArray , RecordCount); SetLength(SLArray , RecordCount); Index := 0; While Not Eof do begin DWArray[Index] := FieldByName('DWFieldName').AsString; SLArray[Index] := FieldByName('SLFieldName').AsString; Inc(Index); Next; end; end; end; 读: StringValue : String; For Index := Low(DWArray) to High(DWArray) do begin StringValue := DWArray[Index] ...//进行组合 end;是你想要的吗?
DWArray : Array of String;
SLArray : Array of Integer;
with DataSet do
begin
Close;
SQL.Clear;
SQL.Add(..)
Open;
First;
if RecordCount > 0 then
begin
SetLength(DWArray , RecordCount);
SetLength(SLArray , RecordCount);
Index := 0;
While Not Eof do
begin
DWArray[Index] := FieldByName('DWFieldName').AsString;
SLArray[Index] := FieldByName('SLFieldName').AsString;
Inc(Index);
Next;
end;
end;
end;
读:
StringValue : String;
For Index := Low(DWArray) to High(DWArray) do
begin
StringValue := DWArray[Index] ...//进行组合
end;是你想要的吗?