J
JohnSun2002
Unregistered / Unconfirmed
GUEST, unregistred user!
这种结构可以用数组解决,而且数组不用手工释放,建议改成:
Type
TDataDic = record
cna: string
//中文名称
eng: string
//英文名称,
FLD: string
//字段类型,
end;
PDataDic = Array of TDataDic;
var fDic : PDataDic;
procedure TQBTable.的Create事件:
while not adsPublic.Eof do
begin
fDic[adsPublic.RecNo].eng:=adsPublic.fieldbyname('SFieldName').AsString;
fDic[adsPublic.RecNo].cna:=adsPublic.fieldbyname('SFieldLabel').AsString;
fDic[adsPublic.RecNo].FLD:=adsPublic.fieldbyname('SFIELDTYPE').AsString;
FLbx.Items.AddObject(fDic[adsPublic.RecNo].cna,TObject(fDic))
//Flbx是一个ListBox板
adsPublic.Next;
end;
procedure TQBTable._CloseBtn(Sender: TObject);
begin
Self.Free;
end;
Type
TDataDic = record
cna: string
//中文名称
eng: string
//英文名称,
FLD: string
//字段类型,
end;
PDataDic = Array of TDataDic;
var fDic : PDataDic;
procedure TQBTable.的Create事件:
while not adsPublic.Eof do
begin
fDic[adsPublic.RecNo].eng:=adsPublic.fieldbyname('SFieldName').AsString;
fDic[adsPublic.RecNo].cna:=adsPublic.fieldbyname('SFieldLabel').AsString;
fDic[adsPublic.RecNo].FLD:=adsPublic.fieldbyname('SFIELDTYPE').AsString;
FLbx.Items.AddObject(fDic[adsPublic.RecNo].cna,TObject(fDic))
//Flbx是一个ListBox板
adsPublic.Next;
end;
procedure TQBTable._CloseBtn(Sender: TObject);
begin
Self.Free;
end;