GetType Operator


GetType Operator

Syntax

     Dim result As System.Type = GetType(typename) 


typename (required; any type)

The name of a type

Description

The GetType operator returns information about a particular type or instance, such as the name, base type, reference or value type status, COM-related GUID, namespace, and so on.

Usage at a Glance

  • Passing an instance variable to GetType generates a compiler error.

  • If you don't know the name of the type about which you'd like to get information, but you do have an object instance of that type, you can retrieve a System.Type object using the Type.GetType method.

Version Differences

The GetType operator is new to VB under .NET.

See Also

CType Function




Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net