C
Charlie Brown
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.Count
For i As Integer = 0 To viCount - 1
Dim vi As ProductionVarianceItem = _varianceList(i)
vi.ProductionOut = GetProductionOut(vi, _varianceList)
Next
End Sub
Private Function GetProductionOut(ByVal item As
ProductionVarianceItem, ByVal itemList As List(Of
ProductionVarianceItem)) As Double
Dim itemCount As Integer = itemList.Count
For i As Integer = 0 To itemCount - 1
Dim vi As ProductionVarianceItem = 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.Count
For i As Integer = 0 To viCount - 1
Dim vi As ProductionVarianceItem = _varianceList(i)
vi.ProductionOut = GetProductionOut(vi, _varianceList)
Next
End Sub
Private Function GetProductionOut(ByVal item As
ProductionVarianceItem, ByVal itemList As List(Of
ProductionVarianceItem)) As Double
Dim itemCount As Integer = itemList.Count
For i As Integer = 0 To itemCount - 1
Dim vi As ProductionVarianceItem = itemList(i)
'do something
Next
End Function