Nullable Types In VB 2005

In one of the MSDN articles on the C# enhancements for the 2005 version, there is a mention of Nullable Types (see http://msdn.microsoft.com/vcsharp/2005/overview/language/nullabletypes/).

Will Nullable Types be also available in VB 2005 I hope so, as Nullable Types is the only language feature that I find compelling enough to make me want to switch.



Answer this question

Nullable Types In VB 2005

  • Jed Atreides

    Nullable types will be available for all languages, as it is implemented within the .NET Framework. However, VB will not have the same support as C#.

    For example:



    Dim nullable As Nullable(Of Integer)

    If (Not nullable.HasValue) Then
     ' Do something
    End If

     



    This can be done in C#, like so:



    int nullable = 10;

    if (nullable == null)
    {
       // Do something
    }

     



  • Suyog

    A.K.

    No the differences don't go beyond syntax. You have the same support in VB, you just have fully write out the name of the Nullable type.

  • WLW

    Thank you David.  That's good news.  Do the support differences that you are referring to, go beyond the syntactical differences that you show in your example

  • Nullable Types In VB 2005