VB program to find the sum of two n matrixes

Program to find the sum of two n ordered matrixes

Sample :



I can't show you complete code Directly so download full code from below .
Download the output  for the form (design).


Dim a(20, 20), b(20, 20), z, x, Y, x1, y1 As Integer


Private Sub Command1_Click()
    Dim i, j As Integer
    Dim s As String
    For i = 0 To x
        For j = 0 To Y
            s = s + Str(a(i, j) + b(i, j)) + " "
        Next j
        List1.List(i) = s
        s = ""
    Next i
End Sub



Private Sub Text1_Change()
     With Text1
        z = Len(.Text)
        .SelStart = z - 1
        .SelLength = z
         If (Val(.SelText) > 0 And Val(.SelText) < 9) Or .SelText = " " Then
         Else
            x = x + 1
            Y = 0
        End If
        If .SelText = " " Then
            Y = Y + 1
        Else
            a(x, Y) = a(x, Y) * 10
            a(x, Y) = a(x, Y) + Val(.SelText)
        End If
        .SelStart = z
    End With
End Sub
 


Private Sub Text2_Change()
    With Text2
        z = Len(.Text)
        .SelStart = z - 1
        .SelLength = z
         If (Val(.SelText) > 0 And Val(.SelText) < 9) Or .SelText = " " Then
         Else
            x1 = x1 + 1
            y1 = 0
        End If
        If .SelText = " " Then
            y1 = y1 + 1
        Else
            b(x1, y1) = b(x1, y1) * 10
            b(x1, y1) = b(x1, y1) + Val(.SelText)
        End If
        .SelStart = z
    End With
End Sub



Full Code :
Output(Matrixadd.exe)

Full code(Matrixadd.doc)

Full project(Matrixadd.zip)

*Note Full project require Visual Basic 6.0