我想调用这个Function,但没有使用参数来进行传值,该如何实现呢?我是用的数组,
非要用参数吗?
调用
Total_AB = 24 * Max_Month()
实现
Private Function Max_Month() As Integer
Const N = 9
Dim A(N), i, j, temp As Integer
A(0) = Combo1.ListIndex + 1: A(1) = Combo2.ListIndex + 1: A(2) =
Combo3.ListIndex + 1: A(3) = Combo4.ListIndex + 1: A(4) =
Combo5.ListIndex + 1
A(5) = Combo6.ListIndex + 1: A(6) = Combo7.ListIndex + 1: A(7) =
Combo8.ListIndex + 1: A(8) = Combo9.ListIndex + 1
For i = 0 To N - 1
For j = i + 1 To N - 1
'升序排列
If (A(j) < A(i)) Then temp = A(i): A(i) = A(j): A(j) = temp
'降序排列
'If (A(j) > A(i)) Then temp = A(i): A(i) = A(j): A(j) = temp
Next
Next
Man_Month = A(j)
End Function