Return variable type (variant subtype).


   varname    The name of the variable

TypeName() has the following return values:

Value Description
Byte Byte value
Integer Integer value
Long Long integer value
Single Single-precision floating-point value
Double Double-precision floating-point value
Currency Currency value
Decimal Decimal value
Date Date or time value
String Character string value
Boolean Boolean value; True or False
Empty Uninitialized
Null No valid data
<object type> Actual type name of an object
Object Generic object
Unknown Unknown object type
Nothing Object variable that has been explicitly set to Nothing, or has been set to return the value of a function that returned Nothing
Error Error
Variant() A Variant array


Dim MyType
MyType = TypeName("SS64") ' Returns "String".
MyType = TypeName(4) ' Returns "Integer".
MyType = TypeName(37.50) ' Returns "Double".

“Who looks outside, dreams; who looks inside, awakes” - Carl Gustav Jung


Dim - Declare a new variable or array variable
Equivalent in PowerShell: Use a comparison operator $myvar -is [bool]

© Copyright SS64.com 1999-2015
Some rights reserved