求此表达式的讲解!
表达式如下:Private Sub Form_Click()
Dim a(10) As Integer
a(1) = 10: a(2) = 15: a(3) = 5: a(4) = 13: a(5) = 20:
a(6) = 31: a(7) = 25: a(8) = 23: a(9) = 1: a(10) = 17
Text1.Text = sum(True, a)
Text2.Text = sum(False, a())
End Sub
Private Function sum(operate As Boolean, a() As Integer) As Long
Dim i As Integer
If operate Then
For i = LBound(a) To UBound(a)
sum = sum + a(i)
Next
Else
sum = 1
For i = LBound(a) To UBound(a)
sum = sum * a(i)
Next
End If
End Function
1.请帮我讲解一下Text1.Text = sum(True, a) 与 Text2.Text = sum(False, a()) 这两句代码中 (True, a) 与(False, a()) 的区别.
2.小弟不才,刚刚才学,For i = LBound(a) To UBound(a)这句也没有搞懂,还请哪位仁兄讲解,多谢!