Как вывести массив в текстбокс или меседжбокс ?
Dim mass(1 To 4) As Double
Dim masss(1 To 4) As Double
Const n = 4
Private Sub CommandButton1_Click()
x = InputBox("x=")
b = InputBox("b=")
If x > 0 And x <> 3 Then
For i = 1 To n
mass(i) = (a * x + (b * b) / (x + i))
Next i
ElseIf x > 2 And x < 4 Then
For p = 1.2 To 3 Step 0.4
masss(p) = Atn(b * p + b) / 1 + Sqr(a * p) + a * x
Next p
Else
y = ((Log(x ^ 2 + 1)) ^ 1 / 3)
End If
TextBox1.Value = x
TextBox2.Value = b
If x > 0 Then
TextBox3.Value = mass
ElseIf x > 2 And x < 4 Then
TextBox3.Value = masss
Else
TextBox3.Value = y
End If
Код:
Dim Index As Integer
If x > 0 Then
'весь массив
'For Index = 0 To UBound(mass)
' TextBox3.text =TextBox3.text + str(mass(Index)) & vbCrLf
'Next
TextBox3.text = str(mass(x))
ElseIf x > 2 And x < 4 Then
'весь массив
'For Index = 0 To UBound(masss)
' TextBox3.text =TextBox3.text + str(masss(Index)) & vbCrLf
'Next
TextBox3.text = str(masss(x))
Else
TextBox3.Value = y
If x > 0 Then
'весь массив
'For Index = 0 To UBound(mass)
' TextBox3.text =TextBox3.text + str(mass(Index)) & vbCrLf
'Next
TextBox3.text = str(mass(x))
ElseIf x > 2 And x < 4 Then
'весь массив
'For Index = 0 To UBound(masss)
' TextBox3.text =TextBox3.text + str(masss(Index)) & vbCrLf
'Next
TextBox3.text = str(masss(x))
Else
TextBox3.Value = y