M
Marek Zegarek
Hello!
I'm trying to write a simple sub, but somewhere I'm making a mistake.....
Problem is somewhere in adding elements to arraylist or dictionary....
I need to add in Dictionary one string and collection of elements as
parameter.
Then I need to add next record to Dictionary with other string and other
collection.
Can someone correct this sample code?
Dim dictAll As New Dictionary(Of String, ArrayList)
Dim arrElem As New ArrayList
Dim I As Integer = 0
Dim collect As String() = {1, 2, 3, 4, 5}
For Each element As String In collect
arrElem.Add(element)
arrElem.Add(element + 2)
dictAll.Add("Wiersz " & I, arrElem)
I += 1
Next
I'm trying to write a simple sub, but somewhere I'm making a mistake.....
Problem is somewhere in adding elements to arraylist or dictionary....
I need to add in Dictionary one string and collection of elements as
parameter.
Then I need to add next record to Dictionary with other string and other
collection.
Can someone correct this sample code?
Dim dictAll As New Dictionary(Of String, ArrayList)
Dim arrElem As New ArrayList
Dim I As Integer = 0
Dim collect As String() = {1, 2, 3, 4, 5}
For Each element As String In collect
arrElem.Add(element)
arrElem.Add(element + 2)
dictAll.Add("Wiersz " & I, arrElem)
I += 1
Next