kolmck/System/D5/sysvarnt.pas
dkolmck 254b27740e read.txt
git-svn-id: https://svn.code.sf.net/p/kolmck/code@17 91bb2d04-0c0c-4d2d-88a5-bbb6f4c1fa07
2009-08-19 09:26:45 +00:00

33 lines
923 B
ObjectPascal

unit sysvarnt;
{X: this unit contains some definitions and initializations, needed to
support variants. To use variants, just place reference to sysvarnt
unit in your unit uses clause *first* }
interface
var
Unassigned: Variant; { Unassigned standard constant }
Null: Variant; { Null standard constant }
EmptyParam: OleVariant; { "Empty parameter" standard constant which can be
passed as an optional parameter on a dual interface. }
implementation
initialization
VarAddRefProc := VariantAddRef;
VarClrProc := VariantClr;
TVarData(Unassigned).VType := varEmpty;
TVarData(Null).VType := varNull;
TVarData(EmptyParam).VType := varError;
TVarData(EmptyParam).VError := $80020004; //DISP_E_PARAMNOTFOUND
ClearAnyProc := @VarInvalidOp;
ChangeAnyProc := @VarCastError;
RefAnyProc := @VarInvalidOp;
finalization
end.