44
Рис. 2.7. Решение в редакторе Visual Basic
Выполним команду
Сервис – Макрос – Редактор Visual Basic
, в
открывшемся окне выберем
Insert - Module
и введем код программы на
языке Visual Basic:
Function toch(ByRef x() As Double, ByRef G() As Double)
e = ActiveSheet.Cells(10, 3).Value
toch = True
For i = 1 To 4
If Abs(x(i) - G(i)) > e Then
toch = False
End If
Next i
End Function
Private Sub CommandButton1_Click()
n = 4
Dim A() As Double: ReDim A(1 To n, 1 To n)
Dim AA() As Double: ReDim AA(1 To n, 1 To n)
Dim F() As Double: ReDim F(1 To n)
Dim FF() As Double: ReDim FF(1 To n)
Dim B() As Double: ReDim B(1 To n, 1 To n)
Dim G() As Double: ReDim G(1 To n)
Dim x() As Double: ReDim x(1 To n)
Dim i As Integer