Z
zpselect
Unregistered / Unconfirmed
GUEST, unregistred user!
我测了一下ListCount是从1开始的,所以我改了一下代码用
Memo1和Memo2分别将其内容显示出为,结果是相同的,但是将其加载到数集中却又报地址错误!
procedure TMainForm.m_CopyClick(Sender: TObject);
var
strList: TStringList;
i, j: integer;
begin
inherited;
try
strList := TStringList.Create;
with DM do
begin
for i := 0 to E_Data.FieldCount-1 do
begin
if (E_Data.Fields.FieldName = 'RKEY') or (E_Data.Fields.FieldName = 'signature')
or (E_Data.Fields.FieldName = 'BM_MC') then
continue;
strList.Add(E_data.Fields.AsString);
Memo1.Lines.Add(E_data.Fields.AsString)
end;
E_Data.Append;
for i := 0 to StrList.Count-1 do
begin
if (E_Data.Fields.FieldName = 'RKEY') or (E_Data.Fields.FieldName = 'signature')
or (E_Data.Fields.FieldName = 'BM_MC') then
continue;
// ShowMessage(StrList[i-1]);
E_Data.Fields.AsString := strList[i-1];
Memo2.Lines.Add(strList[i-1]);
end;
end;
finally
strList.Free;
end;
end;
Memo1和Memo2分别将其内容显示出为,结果是相同的,但是将其加载到数集中却又报地址错误!
procedure TMainForm.m_CopyClick(Sender: TObject);
var
strList: TStringList;
i, j: integer;
begin
inherited;
try
strList := TStringList.Create;
with DM do
begin
for i := 0 to E_Data.FieldCount-1 do
begin
if (E_Data.Fields.FieldName = 'RKEY') or (E_Data.Fields.FieldName = 'signature')
or (E_Data.Fields.FieldName = 'BM_MC') then
continue;
strList.Add(E_data.Fields.AsString);
Memo1.Lines.Add(E_data.Fields.AsString)
end;
E_Data.Append;
for i := 0 to StrList.Count-1 do
begin
if (E_Data.Fields.FieldName = 'RKEY') or (E_Data.Fields.FieldName = 'signature')
or (E_Data.Fields.FieldName = 'BM_MC') then
continue;
// ShowMessage(StrList[i-1]);
E_Data.Fields.AsString := strList[i-1];
Memo2.Lines.Add(strList[i-1]);
end;
end;
finally
strList.Free;
end;
end;