System.Variant.AsType
C++
Variant AsType(int VarType) const;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | sysvari.h | System | Variant |
Description
Casts a Variant object to the type specified by the VarType argument.
AsType returns a new Variant with the same value as this Variant, but with the type specified by VarType. After the call to AsType, there are two Variant objects of the same type.
The VarType parameter is an integer, with possible values listed in the following table.
Int value | Variant type |
---|---|
0x0000 |
Empty |
0x0001 |
Null |
0x0002 |
Smallint |
0x0003 |
Integer |
0x0004 |
Single |
0x0005 |
Double |
0x0006 |
Currency |
0x0007 |
Date |
0x0008 |
OleStr |
0x0009 |
Dispatch |
0x000A |
Error |
0x000B |
Boolean |
0x000C |
Variant |
0x000D |
Unknown |
0x0010 |
ShortInt |
0x0011 |
Byte |
0x0012 |
Word |
0x0013 |
LongWord |
0x0014 |
Int64 |
0x0015 |
UInt64 |
0x0048 |
StrArg |
0x0100 |
String |
0x0101 |
Any |
0x0102 |
UString |
0x0FFF |
TypeMask |
0x2000 |
Array |
0x4000 |
ByRef |