Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Visual Basic - Parsing/arrays

vb.net array

  • Please log in to reply
1 reply to this topic

#1 recycle4

recycle4

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts
  • Learning:(Visual) Basic

Posted 29 October 2012 - 01:02 PM

I am having trouble understanding how to parse the following code into string/double variables that I can turn into an array.



Earth(3,19)
Romulus(10,19)
Andor(2,13)
Vulcan(6,9)
Betazed(20,19)
Risa(16,15)
Cardassia(21,13)
Bajor(22,5)
Deep Space 9(21,2)
Starbase 216(10,3)

I am given the following code, but am not understanding how to transfer the data I need to use into this... THANK YOU SO MUCH!


<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Form1
Inherits System.Windows.Forms.Form

'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
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()
Me.Button1 = New System.Windows.Forms.Button()
Me.ListBox1 = New System.Windows.Forms.ListBox()
Me.Button2 = New System.Windows.Forms.Button()
Me.ListBox2 = New System.Windows.Forms.ListBox()
Me.SuspendLayout()
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(21, 27)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(259, 40)
Me.Button1.TabIndex = 0
Me.Button1.Text = "Parse"
Me.Button1.UseVisualStyleBackColor = True
'
'ListBox1
'
Me.ListBox1.FormattingEnabled = True
Me.ListBox1.Location = New System.Drawing.Point(21, 108)
Me.ListBox1.Name = "ListBox1"
Me.ListBox1.Size = New System.Drawing.Size(258, 69)
Me.ListBox1.TabIndex = 1
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(21, 188)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(87, 19)
Me.Button2.TabIndex = 2
Me.Button2.Text = "GetDestination"
Me.Button2.UseVisualStyleBackColor = True
'
'ListBox2
'
Me.ListBox2.FormattingEnabled = True
Me.ListBox2.Location = New System.Drawing.Point(22, 214)
Me.ListBox2.Name = "ListBox2"
Me.ListBox2.Size = New System.Drawing.Size(257, 30)
Me.ListBox2.TabIndex = 3
'
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(292, 266)
Me.Controls.Add(Me.ListBox2)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.ListBox1)
Me.Controls.Add(Me.Button1)
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)

End Sub
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents ListBox1 As System.Windows.Forms.ListBox
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents ListBox2 As System.Windows.Forms.ListBox

End Class
  • 0

#2 BlackRabbit

BlackRabbit

    CodeCall Legend

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3871 posts
  • Location:Argentina
  • Programming Language:C, C++, C#, PHP, JavaScript, Transact-SQL, Bash, Others
  • Learning:Java, Others

Posted 29 October 2012 - 09:03 PM

What is the actual problem? i don't see any related code ...

where do you have that values? in a file? in a string ?
are you asking how to create a list and load it from the form controls?

please provide some more input so we can help :D
  • 0





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download