' This will determine the pay precent based of a function
Dim decRaisePercent As Decimal
Dim intCount As Integer = 0
For intCount = 1 To _intSizeOfArray
decRaisePercent = RaisePercentage(_strRaiseId)
Next
For intCount = 1 To _intLifeOfItems
_decNewPayRate(_intSizeOfArray) += _decPayRate(_intSizeOfArray) * decRaisePercent
Next
Function RaisePercentage(ByRef strRaiseId() As String) As Decimal
Dim RaisePercent As Decimal
MessageBox.Show("test " & strRaiseId(_intSizeOfArray))
Select Case strRaiseId(_intSizeOfArray)
Case "A1"
RaisePercent = 0.015D
Case "A2"
RaisePercent = 0.02D
Case "A3"
RaisePercent = 0.025D
End Select
Return RaisePercent
End Function
你好,我的数组值没有传递给函数,我无法弄清楚是什么问题。值应为A1,A2,A1和A3,但它仅在消息框中将A3返回给我。任何人都可以帮我弄清楚我有多愚蠢吗?
提前感谢您的帮助!
答案 0 :(得分:0)
这个表达式:
strRaiseId(_intSizeOfArray)
表示“给我数组末尾的项目”。
更改函数,而不是数组,接受数组中的 index 或数组中每个项目的实际单元格值。