First, this program calls VarType on an Integer. We print the String representation of the VariantType result. We show the GetType function, which is separate.
Module Module1
Sub Main()
' Integer.
Dim value As Integer = 5
' Get VarType.
Dim type As VariantType = VarType(value)
' Write string representation.
Console.WriteLine(type.ToString())
' Show GetType method.
Console.WriteLine(value.GetType().ToString())
' You can check the VariantType against constants.
If type = VariantType.Integer Then
Console.WriteLine(
"It's an integer!")
End If
End Sub
End Module
Integer
System.Int32
It's an integer!