Go Back  Xtreme Visual Basic Talk > Visual Basic .NET (2002/2003/2005/2008, including Express editions) > .NET General > Help needed


Reply
 
Thread Tools Display Modes
  #41  
Old 04-21-2012, 11:26 AM
Pravish Pravish is offline
Regular
 
Join Date: Mar 2012
Posts: 50
Default


but the other person said:
The very first requirement says:
"When the program starts, it must load a series of parallel arrays with the following data in the following order:

1017 CA-North Homer Gomez
1007 AZ Jake Johansen
1005 TX-Dallas Paula Hendricks
1010 AZ-Phoenix Henry Abernathy
"
So, you've failed the first requirement, you are not initializing the arrays in that order.
and i have done:
Public Class StoreInformationForm
Dim numbers() As String = {"1005", "1007", "1010", "1017"}
Dim state() As String = {"TX-Dallas", "AZ", "AZ-Phoenix", "CA-North"}
Dim manager() As String = {"Paula Hendricks", "Jake Johansen", "Henry Abernathy", "Homer Gomez"}
Private Sub StoreInformationForm_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Dim number() As Integer = {1005, 1007, 1010, 1017}
Array.Sort(number)
Dim indexnumber As Integer
Integer.TryParse(numberTextBox.Text, indexnumber)
numberTextBox.Text = numbers(indexnumber)
Integer.TryParse(stateTextBox.Text, indexnumber)
stateTextBox.Text = state(indexnumber)
Integer.TryParse(managerTextBox.Text, indexnumber)
managerTextBox.Text = manager(indexnumber)
numberTextBox.ReadOnly = True
stateTextBox.ReadOnly = True
managerTextBox.ReadOnly = True
updateButton.Enabled = False
cancelProcessButton.Enabled = False
End Sub 'StoreInformationForm_Load
Private Sub addButton_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles addButton.Click
Dim numbers As Integer
Dim state As Char
Dim manager As Char
numberTextBox.ReadOnly = False
stateTextBox.ReadOnly = False
managerTextBox.ReadOnly = False
numberTextBox.Clear()
stateTextBox.Clear()
managerTextBox.Clear()
Integer.TryParse(numberTextBox.Text, numbers)
If numbers < 1000 And numbers > 9999 Then
Call DisplayMessage("Store number must be between 1000 and 9999 inclusive.")
Exit Sub
End If 'number < 1000
Char.TryParse(stateTextBox.Text, state)
If state < "1" Then
Call DisplayMessage("State description must be 1-20 characters in lenght.")
Exit Sub
End If 'state < "1"
Char.TryParse(managerTextBox.Text, manager)
If manager < "1" Then
Call DisplayMessage("Manager's name must be 1-30 characters in lenght.")
Exit Sub
End If ' manager < "1"
previousButton.Enabled = False
nextButton.Enabled = False
addButton.Enabled = False
editButton.Enabled = False
deleteButton.Enabled = False
updateButton.Enabled = True
cancelProcessButton.Enabled = True
stateTextBox.Clear()
managerTextBox.Clear()
numberTextBox.Clear()
numberTextBox.Focus()
End Sub 'addButton_Click
Private Sub cancelProcessButton_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles cancelProcessButton.Click
numberTextBox.ReadOnly = True
stateTextBox.ReadOnly = True
managerTextBox.ReadOnly = True
previousButton.Enabled = True
nextButton.Enabled = True
addButton.Enabled = True
editButton.Enabled = True
deleteButton.Enabled = True
updateButton.Enabled = False
cancelProcessButton.Enabled = False
End Sub 'cancelProcessButton_Click
Private Sub deleteButton_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles deleteButton.Click
If MessageBox.Show("Delete the current record?", "Store Information - Delete a store", _
MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, _
MessageBoxDefaultButton.Button1) = DialogResult.Yes Then
numberTextBox.Text = String.Empty
stateTextBox.Text = String.Empty
managerTextBox.Text = String.Empty
End If 'MessageBox.Show
End Sub 'deleteButton_Click
Private Sub editButton_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles editButton.Click
numberTextBox.ReadOnly = False
stateTextBox.ReadOnly = False
managerTextBox.ReadOnly = False
previousButton.Enabled = False
nextButton.Enabled = False
addButton.Enabled = False
editButton.Enabled = False
deleteButton.Enabled = False
updateButton.Enabled = True
cancelProcessButton.Enabled = True
cancelProcessButton.Focus()
numberTextBox.Focus()
End Sub 'editButton_Click
Private Sub updateButton_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles updateButton.Click
Dim number As String
Dim state As String
Dim manager As String
number = numberTextBox.Text.Trim
state = stateTextBox.Text.Trim
manager = managerTextBox.Text.Trim
numberTextBox.ReadOnly = True
stateTextBox.ReadOnly = True
managerTextBox.ReadOnly = True
previousButton.Enabled = True
nextButton.Enabled = True
addButton.Enabled = True
editButton.Enabled = True
deleteButton.Enabled = True
updateButton.Enabled = False
cancelProcessButton.Enabled = False
End Sub 'updateButton_Click
Private Sub DisplayMessage(ByVal prompt As String)
'Display message
MessageBox.Show(prompt, "Store Information - Add or Delete a Store", _
MessageBoxButtons.OK, MessageBoxIcon.Exclamation, _
MessageBoxDefaultButton.Button1)
End Sub 'DisplayMessage
Private Sub nextButton_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles nextButton.Click
'If indexNumber is less than number of stores
'Increment the indexNumber
' DisplayStoreInformation() 'Will use the value of indexNumber to fill the textboxes
'End If
End Sub 'nextButton_Click

Private Sub previousButton_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles previousButton.Click
'If indexNumber > firstindex Then
'Decrement the indexNumber
' DisplayStoreInformation()
'End If
End Sub 'previousButton_Click
End Class 'StoreInformationForm
Reply With Quote
  #42  
Old 04-21-2012, 07:15 PM
passel's Avatar
passel passel is offline
Sinecure Expert

Super Moderator
* Guru *
 
Join Date: Jun 2003
Location: Upstate New York, usa
Posts: 7,913
Default

Dim numbers() As String = {"1005", "1007", "1010", "1017"}

What order are these elements in the array?
That is, tell me which is first and which is third.

Given this list, which number is first? Which number is third?
1017 CA-North Homer Gomez
1007 AZ Jake Johansen
1005 TX-Dallas Paula Hendricks
1010 AZ-Phoenix Henry Abernathy

Is the order the same in both?

If you don't understand the concept of multiple items being organized into a list, and that list having an order from first item in the list (also referred to or impleneted as an array in programming languages), to the last item in the list, how are you going to be able to implement a sort of the list?

It still seems you are just copying lines of code into the file with no comprehension of why you're doing it or what the line of code does.
If you can't understand the concept of what an array is, the project is beyond your abilities.
Since the instructor gives "A"'s for this level of comprehension, I'm not sure why your're sweating this.
__________________
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.
Reply With Quote
Reply

Tags
c++, vb code


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->