我想构建一个类似表的类,该类能够记录字段名称、字段类型、字段值,在表中的纵坐标值、横坐标值我定如下
TExcelField = class; TExcelFields = class; TExcelTable = class
private
public
FFieldCount :Integer;
FRecordCount :Integer;
FExcelFieldList : array[1..RECCOUNT] of TExcelFields;
end;
TExcelField=class(TObject)
private
function GetCFName:string;
function GetFName:string;
function GetFType:string;
function GetValue:string;
public
FCFName: string; //字段中文名称
FFName: string; //字段名称
FFType: string; //字段类型
FValue: string; //字段值
constructor Create(); reintroduce;
destructor Destroy; reintroduce; property CFName:string read GetCFName;
property FName:string read GetFName;
property FType:string read GetFType;
property Value:string read GetValue; end; TExcelFields=class(TObject)
private public
FExlField: array[1..MAXCOUNT] of TExcelField; //字段序列
end;
有什么不好的地方吗?
TExcelField = class; TExcelFields = class; TExcelTable = class
private
public
FFieldCount :Integer;
FRecordCount :Integer;
FExcelFieldList : array[1..RECCOUNT] of TExcelFields;
end;
TExcelField=class(TObject)
private
function GetCFName:string;
function GetFName:string;
function GetFType:string;
function GetValue:string;
public
FCFName: string; //字段中文名称
FFName: string; //字段名称
FFType: string; //字段类型
FValue: string; //字段值
constructor Create(); reintroduce;
destructor Destroy; reintroduce; property CFName:string read GetCFName;
property FName:string read GetFName;
property FType:string read GetFType;
property Value:string read GetValue; end; TExcelFields=class(TObject)
private public
FExlField: array[1..MAXCOUNT] of TExcelField; //字段序列
end;
有什么不好的地方吗?
FCFName: string; //字段中文名称
FFName: string; //字段名称
FFType: string; //字段类型
FValue: string; //字段值
不用public
2.
FExcelFieldList : array[1..RECCOUNT] of TExcelFields;
不灵活,TList好些
3.
FFieldCount :Integer;
FRecordCount :Integer;
原定义是个一维数组,为啥2个count尼粗看了下,供参考
可以包装一个List,该list存放Field对象;
提供查找Field方法,添加、删除Field等(依据实际需要)