[patch_done] ZVariant
Posted: 08.02.2010, 15:02
The Type TZVariant in all versions is a real memory waster.
Putting vtBoolean,vtFloat.vtDatetime and vtPointer in a case record
saves memory with any loss in function.
{** Defines a variant structure. }
TZVariant = packed record
VType: TZVariantType;
VString: AnsiString;
VUnicodeString: WideString;
VInterface: IZInterface;
//### 08.02.2010 Scheurer vtBoolean, vtInteger are alternatives
//### and not additive
case TZVariantType of
vtBoolean: (VBoolean: Boolean);
vtInteger: (VInteger: Int64);
vtFloat: (VFloat: Extended);
VtDateTime: (VDateTime: TDateTime);
VtPointer: (VPointer: Pointer);
end;
vtString, vtUnicodestring and vtInterface are not allowed in case records.
K.Scheurer
Putting vtBoolean,vtFloat.vtDatetime and vtPointer in a case record
saves memory with any loss in function.
{** Defines a variant structure. }
TZVariant = packed record
VType: TZVariantType;
VString: AnsiString;
VUnicodeString: WideString;
VInterface: IZInterface;
//### 08.02.2010 Scheurer vtBoolean, vtInteger are alternatives
//### and not additive
case TZVariantType of
vtBoolean: (VBoolean: Boolean);
vtInteger: (VInteger: Int64);
vtFloat: (VFloat: Extended);
VtDateTime: (VDateTime: TDateTime);
VtPointer: (VPointer: Pointer);
end;
vtString, vtUnicodestring and vtInterface are not allowed in case records.
K.Scheurer