I am new to VB.NET and I need help finding and updating
values in an arraylist.
My arraylist is called arrVarInfo and holds data in this
structure type:
Public Structure VarInfo
Dim Name As String
Dim Format As String
Dim Desc As String
Dim Type As String
Dim Len As String
Dim BegPos As String
Dim EndPos As String
End Structure
I have no problem populating Name, Format, and Desc using
the Add method. However, later in the code I want to
search for a particular Name and insert values in Type,
Len, BegPos, EndPos.
This is the code I've tried:
For Each structVarInfo In arrVarInfo
If structVarInfo.Name = strTemp.Substring(10, 8) Then
With structVarInfo
.BegPos = strTemp.Substring(5, 4)
If strTemp.Chars(19) = "$" Then
.Type = "A"
Else
.Type = "N"
.Len = strTemp.Chars(19)
.EndPos = CStr(CInt(strTemp.Substring(5,
4)) + CInt(CStr(strTemp.Chars(19))))
End If
End With
End If
Next
What am I missing? Any help ASAP would be greatly
appreciated. Thanks.