I am using something like the following function to loop through a
recipe program I am working on. As I was writing it, I starting
thinking this isn't going to work at all... but not I'm not so sure.
Will this code work, or cause me problems?
Private Sub DoSomething()
Dim viCount As Integer = _varianceList.C ount
For i As Integer = 0 To viCount - 1
Dim vi As ProductionVaria nceItem = _varianceList(i )
vi.ProductionOu t = GetProductionOu t(vi, _varianceList)
Next
End Sub
Private Function GetProductionOu t(ByVal item As
ProductionVaria nceItem, ByVal itemList As List(Of
ProductionVaria nceItem)) As Double
Dim itemCount As Integer = itemList.Count
For i As Integer = 0 To itemCount - 1
Dim vi As ProductionVaria nceItem = itemList(i)
'do something
Next
End Function
recipe program I am working on. As I was writing it, I starting
thinking this isn't going to work at all... but not I'm not so sure.
Will this code work, or cause me problems?
Private Sub DoSomething()
Dim viCount As Integer = _varianceList.C ount
For i As Integer = 0 To viCount - 1
Dim vi As ProductionVaria nceItem = _varianceList(i )
vi.ProductionOu t = GetProductionOu t(vi, _varianceList)
Next
End Sub
Private Function GetProductionOu t(ByVal item As
ProductionVaria nceItem, ByVal itemList As List(Of
ProductionVaria nceItem)) As Double
Dim itemCount As Integer = itemList.Count
For i As Integer = 0 To itemCount - 1
Dim vi As ProductionVaria nceItem = itemList(i)
'do something
Next
End Function
Comment