March 2000
Intermediate to advanced
576 pages
18h 13m
English
VarAsType Function
function VarAsType(const V: Variant; VarType: Integer): Variant;
VarAsType performs a typecast of
V to a new Variant type.
VarType must not contain the
varArray or varByRef bits. If V
cannot be converted to the desired type, VarAsType
reports runtime error 15
(EVariantError).
VarAsType is a real function.
VarAsType is a functional version of
VarCast. If you want to assign the result to an
OleVariant, you should use
VarCast instead, because it performs additional
type checking.
If the type of Source is already
VarType, VarAsType performs a
simple copy.
Int := 1;
Float := VarAsType(Int, varDouble);| OleVariant Type, TVarData Type, VarCast Procedure, VarCopy Procedure, Variant Type, VarIsArray Function, VarIsEmpty Function, VarIsNull Function |
Read now
Unlock full access