The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Just playing with Generics in Visual Basic Whidbey

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Duncan Mackenzie

Posts: 689
Nickname: duncanma
Registered: Aug, 2003

Duncan Mackenzie is the Visual Basic Content Strategist at msdn.microsoft.com
Just playing with Generics in Visual Basic Whidbey Posted: Feb 19, 2004 5:03 PM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Duncan Mackenzie.
Original Post: Just playing with Generics in Visual Basic Whidbey
Feed Title: Code/Tea/Etc...
Feed URL: /msdnerror.htm?aspxerrorpath=/duncanma/rss.aspx
Feed Description: Duncan is the Visual Basic Content Strategist at MSDN, the editor of the Visual Basic Developer Center (http://msdn.microsoft.com/vbasic), and the author of the "Coding 4 Fun" column on MSDN (http://msdn.microsoft.com/vbasic/using/columns/code4fun/default.aspx). While typically Visual Basic focused, his blogs sometimes wanders off of the technical path and into various musing of his troubled mind.
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Duncan Mackenzie
Latest Posts From Code/Tea/Etc...

Advertisement

My simple class:

Public Class Customer
    Dim m_CustomerName As String
    Dim m_CustomerID As Integer
    Public Property CustomerName() As String
        Get
            Return m_CustomerName
        End Get
        Set(ByVal Value As String)
            m_CustomerName = Value
        End Set
    End Property
    Public Property CustomerID() As Integer
        Get
            Return m_CustomerID
        End Get
        Set(ByVal Value As Integer)
            m_CustomerID = Value
        End Set
    End Property
End Class

Then creating a Generic List and working with it:
    Private Sub FillCustomers()
        Dim myCustomers _
            As New Generic.List(Of Customer)
        Dim C As Customer
        For i As Integer = 1 To 500
            C = New Customer
            C.CustomerID = i
            C.CustomerName = "Name " & i
            myCustomers.Add(C)
        Next
        For Each cust As Customer In myCustomers
            Debug.Print(cust.CustomerName)
        Next
    End Sub

Now, isn't that nice?

Read: Just playing with Generics in Visual Basic Whidbey

Topic: VS.Net multi language bug - 2.5 years and still going strong? Previous Topic   Next Topic Topic: Microsoft co-founder to demo always-on mini PC

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use