Tyler:He needs to simply put a MessageBox after each of the 2 or 3 statements and see where the value in the TextBox is being changed to 0. My guess it is not being changed to 0 at all. I need him to evaluate the statement where it is being changed before I can help him. If he just posts up the entire class I am not going to do anything until he does his own leg work to at least identify the specific problem statement.
There is a diference between helping someone and doing their work for them. Rick USA----- Original Message ----- From: "Tyler Littlefield" <tyler@xxxxxxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx> Sent: Tuesday, December 02, 2008 7:32 AM Subject: Re: Shipping Project
he got mod on blindgeeks. I kinda heloped him, he just told me his google query failed,a nd appaerently didn't want to read the docs. I pointed him to the convert class.Thanks, Tyler Littlefield email: tyler@xxxxxxxxxxxxx web: tysdomain-com Visit for quality software and web design. skype: st8amnd2005----- Original Message ----- From: "Ricks Place" <OFBGMail@xxxxxxxxx>To: <programmingblind@xxxxxxxxxxxxx> Sent: Tuesday, December 02, 2008 4:18 AM Subject: Re: Shipping ProjectMarv: I can not understand your statement: okay did that, and i think i know where the error is, but how to fix it?i think when i did the error checking for if the shipping code had a decimalor not, think it is throwing that out.What makes you think something is getting thrown out during yourIndexOf Statement over the ShippingCode TextBox Text Property? Is that if statement throwing an exception which would indicate that the ShippingCode Text Property contains a Decimal Point? What is the value of the ShippingCode TextBox Text Property after the if statement that is checking for the Decimal Point if you are getting past that point? Where does the Shipping Code get changed from the 6 character value you typed in to a 0? You type a Shipping Code into the TextBox then perform a couple of tests on it's text property and somehow you are telling me it is getting changed from the 6 cnumbers you type in to a 0. Exactly where is it getting changed to 0? Which statement is the last statement where it is the 6 digits you typed in and exactly which statement is executed just before the message boxes indicate it has been changed to 0?Rick USA----- Original Message ----- From: "Marvin Hunkin" <startrekcafe@xxxxxxxxx>To: <programmingblind@xxxxxxxxxxxxx> Sent: Monday, December 01, 2008 8:23 PM Subject: Shipping ProjectHi.did a project for one of the chapters in my book, for my programming class. the program, asks to enter a shipping code, the number of pounds and ounces,then displays the cost of the total package.now, when i click on the calculate button, instead of showing me say a 7 or8 digit code, it just shows a 0. so how can i fix this one. will paste the message and my code below. cheers Marvin. Hi. did this project out of my programming book for my programming class. will post the message below. if any one can shed light on how to fix this problem i am having. let me know. cheers Marvin. Hi. okay did that, and i think i know where the error is, but how to fix it?i think when i did the error checking for if the shipping code had a decimalor not, think it is throwing that out.so have put message boxes, before and after, and also, the formatting area,i think was throwing it out. can you help me how to fix this one? have never seen this one before? either post on list or e-mail me off list, what ever makes you feel more comfortable. cheers and thanks for your help so far. getting there slowly.ps: now will paste my code below, entire program, easier then trying to pickout bits and pieces. 'Program: Shipping 'Programmer: Marvin Hunkin 'Date: Tuesday September 30 2008 'Description: Calculate Shipping Charge For A Post Office Public Class frmShipping 'Declare Constant. Const decShipping_Rate_Decimal As Decimal = 0.12Private Sub btnCalculateButton_Click(ByVal sender As Object, ByVal e AsSystem.EventArgs) Handles btnCalculateButton.Click 'Declare Variables. Dim intShippingCode As Integer = 0 Dim intPounds As Integer = 0 Dim intOunces As Integer = 0 Dim decShippingCharge As Decimal = 0 Dim intTotalOunces As Integer = 0 ' Validate Inputs ' First check for numeric in general If Not IsNumeric(tbPoundsTextBox.Text) ThenMessageBox.Show("Error: You Did Not Enter A Valid Numeric ValueFor Pounds.", "Data Error", _ MessageBoxButtons.OK, MessageBoxIcon.Exclamation) tbPoundsTextBox.Focus() Return End If If Not IsNumeric(tbOuncesTextBox.Text) ThenMessageBox.Show("Error: You Did Not Enter A Valid Numeric ValueFor Pounds.", "Data Error", _ MessageBoxButtons.OK, MessageBoxIcon.Exclamation) tbOuncesTextBox.Focus() Return End If If Not IsNumeric(tbShippingCodeTextBox.Text) ThenMessageBox.Show("Error: You Did Not Enter A Valid Numeric ValueFor Shipping Code.", "Data Error", _ MessageBoxButtons.OK, MessageBoxIcon.Exclamation) tbShippingCodeTextBox.Focus() Return End If ' We now have numbers so check if integers ' do this by looking for any decimal point in TextBox string. Dim FoundIndex As Integer = 0 FoundIndex = tbPoundsTextBox.Text.IndexOf(".") If FoundIndex > -1 ThenMessageBox.Show("Error: You Did Not Enter A Valid Numeric ValueFor Pounds.", "Data Error", _ MessageBoxButtons.OK, MessageBoxIcon.Exclamation) tbPoundsTextBox.Focus() Return End If FoundIndex = tbOuncesTextBox.Text.IndexOf(".") If FoundIndex > -1 ThenMessageBox.Show("Error: You Did Not Enter A Valid Numeric ValueFor Pounds.", "Data Error", _ MessageBoxButtons.OK, MessageBoxIcon.Exclamation) tbOuncesTextBox.Focus() Return End If MessageBox.Show("tbShippingCodeTextBox.text = " & tbShippingCodeTextBox.Text) FoundIndex = tbShippingCodeTextBox.Text.IndexOf(".") If FoundIndex > -1 ThenMessageBox.Show("Error: You Did Not Enter A Valid Numeric ValueFor Shipping Code.", "Data Error", _ MessageBoxButtons.OK, MessageBoxIcon.Exclamation) tbShippingCodeTextBox.Focus() Return End If MessageBox.Show("tbShippingCodeTextBox.text = " & tbShippingCodeTextBox.Text) If tbShippingCodeTextBox.Text.Length <= 6 ThenMessageBox.Show("Error: You Did Not Enter A Valid Length For TheShipping Code.", "Data Error", _ MessageBoxButtons.OK, MessageBoxIcon.Exclamation) tbShippingCodeTextBox.Focus() Return End If intPounds = Integer.Parse(tbPoundsTextBox.Text) intOunces = Integer.Parse(tbOuncesTextBox.Text) If intPounds < 0 ThenMessageBox.Show("Error: You Did Not Enter A Positive Value ForShipping Weight.", "Data Error", _ MessageBoxButtons.OK, MessageBoxIcon.Exclamation) tbPoundsTextBox.Focus() Return End If If intOunces < 0 ThenMessageBox.Show("Error: You Did Not Enter A Positive Value ForShipping Weight.", "Data Error", _ MessageBoxButtons.OK, MessageBoxIcon.Exclamation) tbOuncesTextBox.Focus() Return End If intTotalOunces = (intPounds * 16) + intOunces decShippingCharge = intTotalOunces * decShipping_Rate_Decimal 'Format Text Boxes. tbPoundsTextBox.Text = intPounds.ToString() tbOuncesTextBox.Text = intOunces.ToString() MessageBox.Show("tbShippingCodeTextBox.text = " & tbShippingCodeTextBox.Text) tbShippingCodeTextBox.Text = intShippingCode.ToString() tbShippingChargeTextBox.Text = decShippingCharge.ToString("C") tbShippingCodeTextBox.Focus() End Sub Private Sub btnClearButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnClearButton.Click tbShippingCodeTextBox.Clear() tbPoundsTextBox.Clear() tbOuncesTextBox.Clear() tbShippingChargeTextBox.Clear() tbShippingCodeTextBox.Focus() End Sub Private Sub btnExitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExitButton.Click 'Exit the project. Me.Close() End Sub End Class E-mail: startrekcafe@xxxxxxxxx MSN: sttartrekcafe@xxxxxxx Skype: startrekcafe We Are The Borg! You Will Be Assimilated! Resistance Is Futile! Star Trek Voyager Episode 68 Scorpian Part One E-mail: startrekcafe@xxxxxxxxx MSN: sttartrekcafe@xxxxxxx Skype: startrekcafe We Are The Borg! You Will Be Assimilated! Resistance Is Futile! Star Trek Voyager Episode 68 Scorpian Part One E-mail: startrekcafe@xxxxxxxxx MSN: sttartrekcafe@xxxxxxx Skype: startrekcafe We Are The Borg! You Will Be Assimilated! Resistance Is Futile! Star Trek Voyager Episode 68 Scorpian Part One E-mail: startrekcafe@xxxxxxxxx MSN: sttartrekcafe@xxxxxxx Skype: startrekcafe We Are The Borg! You Will Be Assimilated! Resistance Is Futile! Star Trek Voyager Episode 68 Scorpian Part One __________ View the list's information and change your settings at //www.freelists.org/list/programmingblind__________ Information from ESET NOD32 Antivirus, version of virus signature database 3654 (20081201) __________The message was checked by ESET NOD32 Antivirus. http://www.eset.com__________View the list's information and change your settings at //www.freelists.org/list/programmingblind__________View the list's information and change your settings at //www.freelists.org/list/programmingblind__________ Information from ESET NOD32 Antivirus, version of virus signature database 3657 (20081202) __________The message was checked by ESET NOD32 Antivirus. http://www.eset.com
__________View the list's information and change your settings at //www.freelists.org/list/programmingblind