March 2000
Intermediate to advanced
576 pages
18h 13m
English
VarType Function
function VarType(const V: Variant): Integer;
VarType returns a
Variant’s type code. The type code
determines the actual data type of the Variant
value, and whether the Variant is an array or a
reference.
See Chapter 6 for a list of variant type codes.
VarType is a real function.
The type code is a bit mask. The low-order 12 bits specify a type
code, and the higher bits specify additional type information. Use
the varTypeMask constant to find the actual type
code. The possible modifiers are varArray for an
array and varByRef for indirect data.
// Calling VarType is the same as accessing the VType field of the // TVarData record. The following two examples do the same thing. // (Accessing the field is slightly faster, but is harder to read.) I := VarType(V); I := TVarData(V).VType; if VarType(V) = varDateTime then TVarData(V).VDate := Now;
| TVarData Type, Variant Type, VarIsArray Function, VarIsEmpty Function, VarIsNull Function |
Read now
Unlock full access