The VarType function returns an integer value representing the type of the value, if one is present, in the variant input parameter. The following variant types are defined as constants in the WebCore unit:
Type
Description
VARTYPE_NULL (0)
Null (no value)
VARTYPE_ARRAY (1)
Array
VARTYPE_BOOLEAN (2)
Boolean
VARTYPE_CHAR (3)
Char
VARTYPE_CLASS (4)
Class
VARTYPE_DOUBLE (5)
Double
VARTYPE_EXTCLASS (6)
External Class
VARTYPE_EXTINSTANCE (7)
External Instance
VARTYPE_EXTMETHOD (8)
External Method
VARTYPE_INSTANCE (9)
Instance
VARTYPE_INTEGER (10)
Integer
VARTYPE_METHOD (11)
Method
VARTYPE_ROUTINE (12)
Routine
VARTYPE_STRING (13)
String
Examples
var
MyValue: Variant;
begin
MyValue := 'Hello World';
X := VarType(MyValue); // X is 13
MyValue := 198;
X := VarType(MyValue); // X is 10
end