我想调用这个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

IT精英如同彩票:平凡的人像5块也中不到一样普遍,努力一点你中了5元保了个本。奖金越高,机率也就越小,付出的也越多,盖茨如同500万一样稀有。虽然每天忙碌而平凡,但我努力成为精英,做梦中了500万。