Name
SystemTypeName Function
Class
Microsoft. VisualBasic.Information
Syntax
SystemTypeName(vbname)-
vbname(required; String) The name of a VB.NET data type
Return Value
A String indicating the name of a CTS data type
Description
Returns the fully qualified type name of the Common Type System (CTS) data type that corresponds to a particular Visual Basic data type
Rules at a Glance
vbnamemust be the name of a valid VB.NET data type, such as Boolean, Byte, Char, Date. Decimal, Double, Integer, Long, Object, Short, Single, or String.If
vbnameis not a valid VB.NET data type, the function returnsNothing.If
vbnamedoes not directly correspond to a CTS data type, the function returnsNothing. For example, user-defined types created with theStructureconstruct and classes created with theClassconstruct both returnNothingif their data type names are passed to the function.
Example
Public Structure Point Dim x As Integer Dim y As Integer End Structure Public Class CEmployee End Class Module modMain Public Sub Main ' Returns System.Int32 Dim i As Integer = 100 Console.WriteLine("Type of i: " & SystemTypeName(TypeName(i))) ' Returns Nothing Dim o As Object Console.WriteLine("Type of o: " & SystemTypeName(TypeName(o))) ' Returns Nothing Dim oEmp As New CEmployee Console.WriteLIne("Type of oEmp: " & SystemTypeName(TypeName(oEmp))) ' Returns Nothing Dim uPt As Point Console.Writeline("Type of uPt: " & SystemTypeName(TypeName(uPt))) ' Returns System.String Dim sName As String = "This is a string." ...Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access