R
RSH
I have a situation where I need to use a multidimenstional Array in a
dynamic environment. i need to be able to iterate through the loop easily
and I dont know the dimensions so i was trying to find a way to use an
arraylist.
Basically i need to store a list of psuedo properties like so:
Dim aList1 As New ArrayList
Dim aList2 As New ArrayList
Dim Count1 As Integer
Dim Count2 As Integer
aList2.Add("ID") 'Name
aList2.Add("1") 'Ordinal
aList2.Add("16") ' Flags
aList2.Add("0") 'Size
aList2.Add("1") 'DataType
aList2.Add("0") 'Precision
aList2.Add("0") 'Numeric Scale
aList2.Add("False") 'Nullable
aList1.Add(aList2)
------
aList2.Add("COL1") 'Name
aList2.Add("2") 'Ordinal
aList2.Add("16") ' Flags
aList2.Add("0") 'Size
aList2.Add("1") 'DataType
aList2.Add("0") 'Precision
aList2.Add("0") 'Numeric Scale
aList2.Add("False") 'Nullable
aList1.Add(aList2)
MessageBox.Show(aList2.Count)
For Count1 = 0 To aList1.Count - 1
For Count2 = 0 To aList1(Count1).Count - 1
RTB.Text += aList1(Count1)(Count2) & vbCrLf
Next
RTB.Text += vbCrLf
Next
Output:
ID
1
16
0
1
0
0
False
COL1
2
16
0
1
0
0
False
ID
1
16
0
1
0
0
False
COL1
2
16
0
1
0
0
False
Obviously that isn't going to work. What is the proper way to do this?
Thanks,
RSH
dynamic environment. i need to be able to iterate through the loop easily
and I dont know the dimensions so i was trying to find a way to use an
arraylist.
Basically i need to store a list of psuedo properties like so:
Dim aList1 As New ArrayList
Dim aList2 As New ArrayList
Dim Count1 As Integer
Dim Count2 As Integer
aList2.Add("ID") 'Name
aList2.Add("1") 'Ordinal
aList2.Add("16") ' Flags
aList2.Add("0") 'Size
aList2.Add("1") 'DataType
aList2.Add("0") 'Precision
aList2.Add("0") 'Numeric Scale
aList2.Add("False") 'Nullable
aList1.Add(aList2)
------
aList2.Add("COL1") 'Name
aList2.Add("2") 'Ordinal
aList2.Add("16") ' Flags
aList2.Add("0") 'Size
aList2.Add("1") 'DataType
aList2.Add("0") 'Precision
aList2.Add("0") 'Numeric Scale
aList2.Add("False") 'Nullable
aList1.Add(aList2)
MessageBox.Show(aList2.Count)
For Count1 = 0 To aList1.Count - 1
For Count2 = 0 To aList1(Count1).Count - 1
RTB.Text += aList1(Count1)(Count2) & vbCrLf
Next
RTB.Text += vbCrLf
Next
Output:
ID
1
16
0
1
0
0
False
COL1
2
16
0
1
0
0
False
ID
1
16
0
1
0
0
False
COL1
2
16
0
1
0
0
False
Obviously that isn't going to work. What is the proper way to do this?
Thanks,
RSH