March 2000
Intermediate to advanced
576 pages
18h 13m
English
VarCast Procedure
procedure VarCast(var Dest: Variant; const Source: Variant;
VarType: Integer);
procedure VarCast(var Dest: OleVariant; const Source: Variant;
VarType: Integer);
VarCast performs a typecast of
Source to a new Variant type,
storing the result in Dest.
VarType must not contain the
varArray or varByRef bits.
If Dest is an OleVariant, the
new type must be an OLE-compatible type. In particular, you cannot
cast to varString, but must use
varOleStr instead. Otherwise,
VarCast reports runtime error 15
(EVariantError).
VarCast is not a real procedure.
VarCast is similar to
VarAsType. The difference is that
VarCast performs additional tests when casting to
an OleVariant.
If the type of Source is already
VarType, VarCast performs a
simple copy.
var V: Variant; O: OleVariant; begin V := 'This is a test'; // VarType(V) = varString VarCast(O, V, varOleStr);
| OleVariant Type, TVarData Type, VarAsType Function, VarCopy Procedure, Variant Type, VarIsArray Function, VarIsEmpty Function, VarIsNull Function |
Read now
Unlock full access