VarType Function

Used to determine the data type of a variable.

Syntax

result = VarType( value )


Parameters

value

Variant

Value to be typed.


Return Value

Result

Integer

Indicates the data type of value.



Notes

Result takes on the following values:

ResultDescription
0 Nil
2 Integer types of 32 bits or less, signed or unsigned.
3 Int64 or UInt64
5 Double or Single
7 Date
8 String
9 Object
11 Boolean
16 Color

Please note that some earlier versions of REALbasic returned 13 for Object.


Example

The following line of code returns 8 (data type of String):

EditField1.text= Str(VarType("Herman"))

See Also

Variant class, Boolean, Byte, Color, Double, Int16, Int32, Int64, Int8, Integer, Single, String, UInt16, UInt32, UInt64, UInt8 data types; IsNumeric function.