O'Reilly logo

VB.NET Language in a Nutshell, Second Edition by Steven Roman PhD, Paul Lomax, Ron Petrusha

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

  • vbname must 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 vbname is not a valid VB.NET data type, the function returns Nothing.

  • If vbname does not directly correspond to a CTS data type, the function returns Nothing. For example, user-defined types created with the Structure construct and classes created with the Class construct both return Nothing if 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." ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required