Page 1 of 1

[patch_done] ZVariant

Posted: 08.02.2010, 15:02
by scheurer
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

Posted: 09.02.2010, 00:45
by mdaems
SVN Rev 790.