Posted by Dylan on Sunday, December 19, 2010 at 3:20pm.
Some of the tutorials here may help you:
http://search.yahoo.com/search?fr=mcafee&p=Visual+Basic+Tutorial
Sra
HELP?!
"I've tried different methods and I just don't know how to call the index number and make the proper part show up in the VBAuto box!"
If you post what you've tried, we can help you get on the right track. Without seeing your attempts, we don't know where you've got a problem.
Alternatively, you can tell us the symptoms, and we'll help you find the right direction.
Public Class Form1
Public SparkPlugsString(,) As String = {{"VBAutoPart", "Brand A", "Brand C", "Brand X"},
{"PR214", "MR43T", "RBL8", "14K22"},
{"PR223", "R43", "RJ6", "14K24"},
{"PR224", "R43N", "RN4", "14K30"},
{"PR246", "R46N", "RN8", "14K32"},
{"PR247", "R46TS", "RBL17Y", "14K33"},
{"PR248", "R46TX", "RBL12-6", "14K35"},
{"PR324", "S46", "J11", "14k38"},
{"PR326", "SR46E", "XEJ8", "14K40"},
{"PR444", "47L", "H12", "14K44"}}
Private Property VerticalPrintLocationSingle As Object
Public Sub LookupButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LookupButton.Click
Dim PartIndexInteger As Integer
Dim BrandIndexInteger As Integer
BrandIndexInteger = BrandBox.SelectedIndex
PartIndexInteger = PartBox.SelectedIndex
If PartIndexInteger <> -1 And BrandIndexInteger <> -1 Then
VBAutoTextBox.Text =
SparkPlugsString(PartIndexInteger, BrandIndexInteger).ToString("")
Else
MessageBox.Show("Select the Part and Brand.", "Information Missing", MessageBoxButtons.OK, MessageBoxIcon.Asterisk)
End If
End Sub
End Class
This is pretty much what I have.. But I just can't figure it out :-/
I'm a pretty big beginner at this... I tried looking up tutorials (thank you very much for that by the way) and couldn't find what I was looking for...
You have created a multi-dimensional array for the equivalent part numbers.
You will need to search the table for the competitive part number, if there is a match, you will display your own brand's part number. That's the idea.
In practice, you need a for loop to go through all the parts until you find the competitive part number. Then return your own brand.
In more sophisticated systems, the search will not be a sequential search, but more like a binary search on a sorted list or index. For now, with less than 500 parts, efficiency is not a problem.
You must have learned about sequential search and multi-dimensional arrays.
Give it a try, and post what you have. Your current code shows the search of only one item, without searching through the who array. So perhaps you might even have syntax error.
Related Questions
Computer - Write the program that will calculate and display the career ...
visual basic - in visual basic, notes in a program which explain what the ...
visual basic - notes in a program which explain what the program is doing are ...
Visual Basic - Notes in a program which explains what the program is doing are ...
COMPUTER PROGRAMMING - Could you please help me write a program using basic or ...
visual basic 2010 - I am totally lost with arrays. I have a program that needs ...
Programming (Visual Basic) - Im seem to be having trouble with this Exercise. ...
computer science - write a program to select the classes that you are taking(Ex...
hsm 270 - Identify where the program planning and evaluation process can provide...
Business Accounting/Operations Management - Two years have passed since the ...
For Further Reading