Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check type of Object in VB 6 ? - I do not want to use 'TypeOf' method

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 
like image 731
Avinash Avatar asked Sep 22 '10 06:09

Avinash


People also ask

How do you use type as variables?

For example: Type intType = typeof(Int32); object value1 = 1000.1; // Variable value2 is now an int with a value of 1000, the compiler // knows the exact type, it is safe to use and you will have autocomplete int value2 = Convert.

What are the type of variable in VB?

The two major variable categories are numeric and string. Numeric variables store numbers, and string variables store text. Object variables can store any type of data.

How to check for variable type in c#?

The GetType() method of array class in C# gets the Type of the current instance. To get the type. Type tp = value. GetType();


1 Answers

Try the TypeName Function.

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

like image 125
Jay Riggs Avatar answered Oct 17 '22 19:10

Jay Riggs