views:

34

answers:

2

The title says it all really. I want to get the type of a variable using vbscript.

Thanks.

+3  A: 

Is VarType what you need?

Martin Smith
VarType(index) returns 8. What does this mean.
Ash Burlaczenko
8 = vbString - Indicates a string (From the link in my answer)
Martin Smith
Cheers. Common sense should have said to check that before asking. Sorry. +Rep.
Ash Burlaczenko
A: 

If you want to get the type name of an object assigned to a variable with Set, you can use TypeName instead.

Class SomeClass
    '' empty class
End Class

Dim x
Set x = New SomeClass
WScript.Echo TypeName(x)  '' displays "SomeClass"
Tmdean