More please
You need to Dim each object to create a new one before adding it to the list:
Yes Thank you I agree the small sample was lacking that but the original
real code assuredly has the correct list content. the XML/Sax parser Dims each element correctly before adding it to the list. & I have spewed out the list content immediately after filling it to confirm
My small sample now works fine but I cant replicate the functionality in the real code
In My new test I will try reaching across modules like I'm trying to do in the real code. That's the only difference I see here so far .....................
Kevin
Code:
some thoughts:
What is the value of iBinCount?--
Its 7
How many items are in the list?
there's 7 --- funny I addressed the possibility of that discrepancy last week iBinCount( although not visible in my sample is list.size)
If iBinCount is being set to "lstOrderAssignments.Size -1" then why are you taking 1 off again in the For statement?
It's an old comment sorry but....
the list is zero based so to get the FIRST instance in the list you grab zero then one then Two. It's the same for my newly validated variable that correctly reflects list size, IBinCount. 7-1 = 6 , but theres 7 list items counting the one at position zero
Why are you calling the sub in a Try...Catch, and is it possible that an error is occurring preventing the correct data from getting pulled but you don't know because the error is being trapped with Try...Catch?
You should always try to trap errors for even trivial computations / processes in a try catch. Ideally they should bubble up to a main error handler for logging or display to user. I appreciate your intent so just to be thorough I added a msgbox with LastException.Message.
It gets to the next section of code just fine no errors, just botched list content:
Try
currOrdData = daObject.GetSpecificOrderNoPerBinPosition(xBinCount)
Catch
Msgbox(LastException.Message, "ERROR HERE")
'This VERY UGLY logic will allow you out of a missing element at position X
End Try
binCrtl = uiLogic.CreateBinControl(xBinCount, currOrdData)
binCtrlObjLst.Add(binCrtl)
If xBinCount = iBinCountSubOneRef Then
bAllowEntry = True
End If
So again I'm wondering of the jump across modules ??
tmpOrdObj = postMain.lstOrders.Get(iPosition)