tags:

views:

70

answers:

2

How to check type of object in VB 6.0 we have to modify existing code to use 'typeof' method, Is there any method like moving cursor over object variable or like quick watch where I can see its type.

I know following method but I do not want to use it -

Set fs = New Scripting.FileSystemObject 

If TypeOf fs Is Scripting.FileSystemObject Then 
  Debug.Print "Is a FileSystemObject" 
End If 

Thanks in advanced for your answers.

+4  A: 

Try the TypeName Function.

In your example if you enter TypeName(fs) in the Immediate Window you would get back "FileSystemObject"

Jay Riggs
+1 I took the liberty of editing your answer to add a link to the VB6 manual topic for `TypeName`
MarkJ
The original question was, "How to check type of object... other than 'TypeName'" !! (http://stackoverflow.com/questions/3684693/how-to-check-type-of-object-in-vb-6-is-there-any-method-other-than-typename)
onedaywhen
A: 

Right click object variable and select "Quick Info" from context menu.

Smith