Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to return variable type at runtime?????????
Message
From
30/03/2004 13:51:29
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00890850
Message ID:
00890931
Views:
26
Thank You Nick....




>This is based on the sample in the Help
>
>
   Dim MyString As String = "MyString"
>        Dim MyObject As Object
>        Dim MyNumber As Integer = 12345
>
>        Dim MyVarType As VariantType   ' Integer enumeration.
>
>        MyVarType = VarType(MyVarType)   ' Returns VariantType.Integer.
>        MyVarType = VarType(MyString)   ' Returns VariantType.String.
>        MyVarType = VarType(MyObject)   ' Returns VariantType.Object.
>        MyVarType = VarType(MyNumber)   ' Returns VariantType.Integer.
>
>' For any case MyVarType.ToString() will give you the type as a character string
>
>
>
>>Thank you for your response. The vartype was returning a number and I could not tell what the result was. I found out that variable.GetType.ToString() does the trick. BTW How can I find what the return of vartype is telling me?
>>
>>Thank you
>>
>>
>>
>>>>Hello all,
>>>>
>>>>I would like to know how to return a variable type at runtime in vb .net. I am used to programming in Foxpro and I would do something like:
>>>>TYPE(cExpression) which would return the datatype of its contents. If it is an object would return "O", character "C" and so on. Any help would be appreciated.
>>>>
>>>>TIA,
>>>
>>>Look at VarType() function.
Previous
Reply
Map
View

Click here to load this message in the networking platform