I have a program that I created, the result is not appropriate, I want to do multiplication between rows of numbers -1, -1, -1 and 1,2, -1
-1x1 = -1
-1x2 = -2
-1x-1 = 1
then the results are summed
(-1) + (- 2) + 1 = -2
please solution, for multiplication min (-)
Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
Dim Total, Total2 As Integer
Dim y As Integer = 0
Dim b As Integer = 2
Dim getArray As String = TextBox3.Text
Dim arrVin() As Char = getArray.ToCharArray
'Dim getArray2 As String = TextBox2.Text
'Dim arrVin2() As Char = getArray2.ToCharArray
Dim multArr() As Integer = {1, 2, -1}
'Dim m As Integer = 1
'Total = 0
For Each x As String In arrVin
If IsNumeric(x) = True Then
'For Each i As String In arrVin2
'muliply by a bigger number each time
'm = 2
'add the new product to the running total
'Total = Total + (Val(x) + Val(x))
'Total2 = (Val(x) * Val(i)) + Total2
'Total = Total + (m * Val(x))
Total2 += x * multArr(y)
y = y + 1
TextBox1.Text = Total2 + b
End If
Next
End Sub