This topic has not yet been rated - Rate this topic

SystemTypeName Function

Returns a String value that contains the system data type name of a variable.

Public Function SystemTypeName(ByVal VbName As String) As String
VbName

Required. A String variable containing a Visual Basic type name.

SystemTypeName returns the fully qualified common language runtime (CLR) type name corresponding to the Visual Basic type name. For example, if VbName contains "Date", SystemTypeName returns "System.DateTime". If SystemTypeName does not recognize the value of VbName, it returns Nothing (not the string "Nothing").

The following example uses the SystemTypeName function to return data type names for several variables.

Dim vbLongName As String = "Long"
Dim vbDateName As String = "Date"
Dim vbBadName As String = "Number"
Dim testSysName As String
testSysName = SystemTypeName(vbLongName)
' The preceding call returns "System.Int64".
testSysName = SystemTypeName(vbDateName)
' The preceding call returns "System.DateTime".
testSysName = SystemTypeName(vbBadName)
' The preceding call returns Nothing.


Namespace: Microsoft.VisualBasic

Module: Information

Assembly: Visual Basic Runtime Library (in Microsoft.VisualBasic.dll)

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ