Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Help me finish my code

Name: Anonymous 2007-12-05 23:11

Dim strTextBox As String
        Dim decItemPrice As Decimal
        Dim decSubTotal As Decimal
        Dim intNumber As Integer
        Dim decSalesTax As Decimal
        Dim decTotalSale As Decimal

        Do

            strTextBox = InputBox("Enter item price", "Item Price")

            If Decimal.TryParse(strTextBox, decItemPrice) Then

                decItemPrice = Convert.ToDecimal(strTextBox)
                decSubTotal = decItemPrice
                intNumber = intNumber + 1
                txtItemPrice.Text = FormatCurrency(decItemPrice)
                txtSubTotal.Text = FormatCurrency(decSubTotal)
                txtNumber.Text = Convert.ToString(intNumber)

            End If

        Loop Until strTextBox = ""

        decSalesTax = 0.065D * decSubTotal
        decTotalSale = decSubTotal + decSalesTax
        txtSalesTax.Text = FormatCurrency(decSalesTax)
        txtTotalSale.Text = FormatCurrency(decTotalSale)

    End Sub

I need help doing two things: 1) Making sure only numerical data can be entered or else a message box is displayed. 2) Keep a running Sub Total so that the first entered number is added to the second entered and so on until the loop is terminated.

Name: Anonymous 2007-12-05 23:39

10 PRINT "₫"
20 GOTO 10

Name: Anonymous 2007-12-05 23:44

You're going to have to explain that since I'm a complete noob at this stuff.

Name: Anonymous 2007-12-05 23:53

If Decimal.TryParse(strTextBox, decItemPrice) Then
'... test failed ...
else
msgbox "Data must be numeric."
end if


simple shit folks.

Name: Anonymous 2007-12-05 23:54

Name: Anonymous 2007-12-06 0:00

Dim strTextBox As String
        Dim decItemPrice As Decimal
        Dim decSubTotal As Decimal
        Dim intNumber As Integer
        Dim decSalesTax As Decimal
        Dim decTotalSale As Decimal

        Do

            strTextBox = InputBox("Enter item price", "Item Price")

            If Decimal.TryParse(strTextBox, decItemPrice) Then

                decItemPrice = Convert.ToDecimal(strTextBox)
                decSubTotal = decItemPrice
                intNumber = intNumber + 1
                txtItemPrice.Text = FormatCurrency(decItemPrice)
                txtSubTotal.Text = FormatCurrency(decSubTotal)
                txtNumber.Text = Convert.ToString(intNumber)

            Else

                MessageBox.Show("Data must be numeric!")

            End If

        Loop Until strTextBox = ""

        decSalesTax = 0.065D * decSubTotal
        decTotalSale = decSubTotal + decSalesTax
        txtSalesTax.Text = FormatCurrency(decSalesTax)
        txtTotalSale.Text = FormatCurrency(decTotalSale)

    End Sub

Correct?

What about my second question?

Name: Anonymous 2007-12-06 1:25

move the rest of your function into the loop.

Name: Anonymous 2007-12-06 11:02

>>7
move your face into my fist, asshole

Name: Anonymous 2007-12-06 11:32

Move your first into my asshole, face

Name: Anonymous 2007-12-06 13:54

>>8
move your fist into my asshole, face

Name: Anonymous 2007-12-06 15:01

move your asshole into my face, fist

Name: Anonymous 2007-12-06 16:05

face my fist, move into your asshole

Name: Anonymous 2007-12-06 16:08

Underline
Overline
Bold
YOU JUST LOST THE GAME

Name: Anonymous 2007-12-06 16:10

>>13
Go sagetest in some old threads, nigger.

Name: Anonymous 2007-12-06 18:03

Name: Anonymous 2009-03-18 2:43

I wants lots and lots of some delectable pot!

Marijuana MUST be legalized.

Name: Anonymous 2010-11-15 7:39

Name: Anonymous 2011-02-03 4:05

Name: Anonymous 2011-02-03 6:03

Name: Anonymous 2011-02-04 15:06

Name: Anonymous 2011-02-04 16:43

Name: Anonymous 2011-02-18 13:03

check my doubles
Don't change these.
Name: Email:
Entire Thread Thread List