procedure TMdObjDataSet.InternalInitFieldDefs;
var
i: Integer;
begin
if FObjClass =
nil then
raise Exception.Create ('
TMdObjDataSet: Unassigned class');
// field definitions
FieldDefs.Clear;
nProps := GetTypeData(fObjClass.ClassInfo)^.PropCount;
GetMem(PropList, nProps * SizeOf(Pointer));
GetPropInfos (fObjClass.ClassInfo, PropList);
for i := 0
to nProps - 1
do
case PropList [i].PropType^.Kind
of
tkInteger, tkEnumeration, tkSet:
FieldDefs.Add (PropList [i].
Name, ftInteger, 0);
tkChar: FieldDefs.Add (PropList [i].
Name, ftFixedChar, 0);
tkFloat: FieldDefs.Add (PropList [i].
Name, ftFloat, 0);
tkString, tkLString:
FieldDefs.Add (PropList [i].
Name, ftString, 50);
// TODO: fix size
tkWString: FieldDefs.Add (PropList [i].
Name, ftWideString, 50);
// TODO: fix size
end;
end;