为什么同样的代码在98下保存只须10来秒,而在win2000下却需要几分钟呢?/ ( 积分: 50 )

  • 主题发起人 主题发起人 noall
  • 开始时间 开始时间
N

noall

Unregistered / Unconfirmed
GUEST, unregistred user!
aclass := aobject.ClassType;
ClassTypeInfo := aclass.ClassInfo;
ClassTypeData := GetTypeData(ClassTypeInfo);
Proplist := Nil;
FrmProgress.Gauge1.Progress := FrmProgress.Gauge1.Progress + 1;
Try
GetMem(PropList, SizeOf(PPropInfo) * ClassTypeData.PropCount);
getpropinfos(aclass.classinfo, proplist);
For J := 0 To ClassTypeData.PropCount - 1 Do
Begin
Tk := PropList[J]^.PropType^.Kind;
If Tk = tkMethod Then
continue;
{ÏÂÃæÊÇдÈëÊôÐÔÊýÖµ}
Case tk Of
tklstring, tkString, tkWString:
Begin
{ TempInt := 1;
BBstr.Write(TempInt, sizeof(tempint));}
FieldStr := GetStrProp(aobject As aclass,
PropList[J]^.Name);
TempInt := Length(FieldStr);
Bbstr.Write(TempInt, SizeOf(TempInt)); //
Bbstr.Write(FieldStr[1], TempInt);
End;
tkinteger:
Begin
{ TempInt := 2;
BBstr.Write(TempInt, sizeof(tempint)); }
TempInt := GetOrdProp(aobject As aclass,
PropList[J]^.Name);
bbstr.write(TempInt, sizeof(TempInt));
End;
tkFloat:
Begin
Try
TempDou := GetFloatProp(aobject As aclass,
PropList[J]^.Name);
Except
TempDou := 0;
End;
{ TempInt := 3;
BBstr.Write(TempInt, sizeof(tempint));}
bbstr.Write(TempDou, sizeof(TempDou));
End;
tkClass:
Begin
{ TempInt := 5;
BBstr.Write(TempInt, sizeof(tempint));}
childobject := GetObjectProp(aobject As aclass,
PropList[j]^.Name);
apointer := childobject;
atcxbase := TCxList(apointer);
TempStr := Self.GetStrucName;
BBstr.Write(TempStr, WFieldValueLen); //
TempStr := 'nil'; //Èç¹ûΪ¿Õ£¬ÔòÊäÈënil
If atcxbase <> Nil Then
TempStr := atcxbase.GetStrucName;
BBstr.Write(TempStr, WFieldValueLen);
atcxbase.WriteFieldValue(BBstr);
End;
tkEnumeration:
Begin
TempStr := GetEnumProp(aobject As aclass,
PropList[j]^.Name);
len := length(TempStr) + 1;
{ TempInt := 4;
BBstr.Write(TempInt, sizeof(tempint));}
bbstr.write(len, sizeof(integer));
bbstr.Write(TempStr, len);
End;
tkSet:
Begin
{ TempInt := 6;
BBstr.Write(TempInt, sizeof(tempint));}
TempInt := GetOrdProp(aobject As aclass,
PropList[J]^.Name);
bbstr.write(TempInt, sizeof(TempInt));
End;
End; //end case
End; //end for
Finally
FreeMem(PropList, SizeOf(PPropInfo) * ClassTypeData.PropCount);
End;
 
aclass := aobject.ClassType;
ClassTypeInfo := aclass.ClassInfo;
ClassTypeData := GetTypeData(ClassTypeInfo);
Proplist := Nil;
FrmProgress.Gauge1.Progress := FrmProgress.Gauge1.Progress + 1;
Try
GetMem(PropList, SizeOf(PPropInfo) * ClassTypeData.PropCount);
getpropinfos(aclass.classinfo, proplist);
For J := 0 To ClassTypeData.PropCount - 1 Do
Begin
Tk := PropList[J]^.PropType^.Kind;
If Tk = tkMethod Then
continue;
{ÏÂÃæÊÇдÈëÊôÐÔÊýÖµ}
Case tk Of
tklstring, tkString, tkWString:
Begin
{ TempInt := 1;
BBstr.Write(TempInt, sizeof(tempint));}
FieldStr := GetStrProp(aobject As aclass,
PropList[J]^.Name);
TempInt := Length(FieldStr);
Bbstr.Write(TempInt, SizeOf(TempInt)); //
Bbstr.Write(FieldStr[1], TempInt);
End;
tkinteger:
Begin
{ TempInt := 2;
BBstr.Write(TempInt, sizeof(tempint)); }
TempInt := GetOrdProp(aobject As aclass,
PropList[J]^.Name);
bbstr.write(TempInt, sizeof(TempInt));
End;
tkFloat:
Begin
Try
TempDou := GetFloatProp(aobject As aclass,
PropList[J]^.Name);
Except
TempDou := 0;
End;
{ TempInt := 3;
BBstr.Write(TempInt, sizeof(tempint));}
bbstr.Write(TempDou, sizeof(TempDou));
End;
tkClass:
Begin
{ TempInt := 5;
BBstr.Write(TempInt, sizeof(tempint));}
childobject := GetObjectProp(aobject As aclass,
PropList[j]^.Name);
apointer := childobject;
atcxbase := TCxList(apointer);
TempStr := Self.GetStrucName;
BBstr.Write(TempStr, WFieldValueLen); //
TempStr := 'nil'; //Èç¹ûΪ¿Õ£¬ÔòÊäÈënil
If atcxbase <> Nil Then
TempStr := atcxbase.GetStrucName;
BBstr.Write(TempStr, WFieldValueLen);
atcxbase.WriteFieldValue(BBstr);
End;
tkEnumeration:
Begin
TempStr := GetEnumProp(aobject As aclass,
PropList[j]^.Name);
len := length(TempStr) + 1;
{ TempInt := 4;
BBstr.Write(TempInt, sizeof(tempint));}
bbstr.write(len, sizeof(integer));
bbstr.Write(TempStr, len);
End;
tkSet:
Begin
{ TempInt := 6;
BBstr.Write(TempInt, sizeof(tempint));}
TempInt := GetOrdProp(aobject As aclass,
PropList[J]^.Name);
bbstr.write(TempInt, sizeof(TempInt));
End;
End; //end case
End; //end for
Finally
FreeMem(PropList, SizeOf(PPropInfo) * ClassTypeData.PropCount);
End;
 
自由界面和报表的完美解决方案!
http://www.anylib.com
 
后退
顶部