Dim a As Variant
Print TypeName(a) ' Prints "EMPTY"
a = 1
Print TypeName(a) ' Prints "INTEGER"
a = "hello"
Print TypeName(a) ' Prints "STRING"
Dim b As String
Print TypeName(b$) ' Prints "STRING"
' Arrays
Dim arrayl(1 To 4) As Long
Print TypeName(arrayl&) ' Prints "LONG( )"
Dim arrayV(1 To 4)
Print TypeName(arrayV) ' Prints "VARIANT( )"
Dim y As Variant
y = arrayl
Print TypeName(y) ' Prints "LONG( )"
' Lists
Dim listStr List As String
Print TypeName(listStr$) ' Prints "STRING LIST"
Dim listVar List
Print TypeName(listVar) ' Prints "VARIANT LIST"
Dim p As Variant
p = listStr$
Print TypeName(p) ' Prints "STRING LIST"
' Class instances
Class Employee
' ... class definition
End Class
Dim temp As Employee
Print TypeName(temp) ' Prints "EMPLOYEE"
Set hire = New Employee
Print TypeName(hire) ' Prints "EMPLOYEE"
Dim emps(3) As Employee
Print TypeName(emps()) ' Prints "EMPLOYEE( )"
' OLE class instances
Set cal = CreateObject("dispcalc.ccalc")
Print TypeName(cal) ' Prints "OBJECT"