All pastes #798842 Raw Edit

Stuff

public text v1 · immutable
#798842 ·published 2007-11-27 01:39 UTC
rendered paste body
Public Class Form1
    Dim itemUPC(-1) As String
    Dim itemQuantity(-1) As String
    Dim itemName(,) As String = {{"0921115150", "Dark Chocolate Truffles"}, _
    {"2221001501", "Mint Meltaways"}, _
    {"6652300415", "Chocolate Covered Cherries"}, _
    {"0255541028", "Malted Milk Balls"}, _
    {"0921115141", "Chocolate Covered Raisins"}}
    Dim totalquan(-1) As Integer

    Dim upc As String
    Dim quantity As String
    Dim item As String
    Dim totquantemp As Integer

    Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
        quantity = Me.txtQuantity.Text
        ReDim Preserve itemQuantity(itemQuantity.Length)
        itemQuantity(itemQuantity.Length - 1) = quantity

        upc = Me.txtUPC.Text
        ReDim Preserve itemUPC(itemUPC.Length)
        itemUPC(itemUPC.Length - 1) = upc


    End Sub

    Private Sub btnTotals_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTotals.Click
        Dim x, z As Integer

       

        For x = 0 To 4
            For z = 0 To 4
                If itemUPC(x) = itemName(x, 0) Then
                    totalquan(0) = totalquan(0) + itemQuantity(0)

                End If
            Next
            
        Next
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.Close()
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class