Solved arrays

Posted on 2004-11-10
Last Modified: 2010-04-23
I am new at and I have to creat arrays for the descriptions I wan to display on a screen. For example
"First Name"
"Phone Number"
then I will pull the data to show up beside them.  Can anyone give me an example how to create an array for these descriptions.  I don't know how to create an array.

Question by:lindapat
    LVL 27

    Expert Comment

    sample code

    Public Class frmArrList
        Inherits System.Windows.Forms.Form

    #Region " Windows Form Designer generated code "

        Public Sub New()

            'This call is required by the Windows Form Designer.

            'Add any initialization after the InitializeComponent() call
        End Sub

        'Form overrides dispose to clean up the component list.
        Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If Not (components Is Nothing) Then
                End If
            End If
        End Sub

        'Required by the Windows Form Designer
        Private components As System.ComponentModel.IContainer

        'NOTE: The following procedure is required by the Windows Form Designer
        'It can be modified using the Windows Form Designer.  
        'Do not modify it using the code editor.
        <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
            components = New System.ComponentModel.Container()
            Me.Text = "frmArrList"
        End Sub

    #End Region

        Private Sub Test()
            Dim str As String = "John Doe, 1000 UptheStreet Drive, 145-423-9875"
            Dim strarr() As String

            strarr = str.Split(",")
            Dim sText As String
            Dim i As Integer
            Dim myAL As New ArrayList

            For i = LBound(strarr) To UBound(strarr)

            sText = "First Name= " & strarr(0) & vbNewLine
            sText += "Address= " & strarr(1) & vbNewLine
            sText += "Phone Number= " & strarr(2) & vbNewLine

        End Sub
    End Class
    LVL 27

    Accepted Solution

    the myAl is the ArrayList function in Micro$oft

    change code to ...

            sText = "First Name= " & myAL(0) & vbNewLine
            sText += "Address= " & myAL(1) & vbNewLine
            sText += "Phone Number= " & myAL(2) & vbNewLine

    Author Comment

    Thank you sooooooo much. You have been a life saver.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now