Message 1 of 4
Storing Arraylist in System.Collections.ArrayList
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I use System.Collections.ArrayList in my VBA code. I want to add one array to this Array like below:
Dim lateralListesi As Object
Dim i as integer
Set lateralListesi = CreateObject("System.Collections.ArrayList")
lateralListesi.add Array(pipeType, pipeLength)
After than add many pipeTypes I want to check pipeTypes in the lateralListesi. If I added same type in the lateralListesi before than I want to increase pipeLength only like pipeLength = pipeLength + newlyPipeLength
'I read pipeType before. and check if I added before?
For i = 0 To lateralListesi.Count - 1
If lateralListesi.Item(i)(0) = pipeType Then
'Early added.
lateralListesi.Item(i) = Array(pipeType , Val(lateralListesi.Item(i)(1)) + newlyPipeLength)
Else
'Just new adding.
lateralListesi.add Array(pipeType, newlyPipeLength)
End If
Next i
But I don't know why I cannot check inner array like ;
lateralListesi.Item(i)(0)
or
lateralListesi (i) (0)
Where am I wrong? I need two column temp table infact. I did not want to use dim and reDim. Because I don't know the row count in the begining.
Regards,
Mucip:)