473,396 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Searching and updating structures in an arraylist

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.
Nov 21 '05 #1
0 934

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Rustam Asgarov | last post by:
Hi. I have ArrayList that contains structures... I need to iterate through all structures in this array and update one of members in this structures... The first thing that comes to mind is just...
2
by: John Grandy | last post by:
What are good rules of thumb to use when deciding between a NameValueCollection, an ArrayList, or a Hashtable ?
1
by: hazz | last post by:
I have two arraylists that populate two Grid controls. I have two Calendar controls to select a 'From' and 'To' date to filter what is in the grid for subsequent filtered views of the what is...
5
by: John Veldthuis | last post by:
My code works perfectly 100% when adding items to my ArrayList and updating the listbox. Works perfectly when deleting an item in the ArrayList when it is not the last entry but if it is the last...
4
by: MikeY | last post by:
Hi Everyone, I'm am trying to find the best method option for searching through an ArrayList and getting various items at a time. It could be 0 to 14, 15 to 25 etc,etc. I wish .GetRange(0,45)...
4
by: Jon Paal | last post by:
how can I search for a value in a multi - item arraylist to prevent adding duplicates ?
12
by: C#Newbie | last post by:
Hi everyone, I'm new in this group and I have a question that might have been answered already. I created an arraylist that I want to contain the object that I created. But when I try to store...
3
by: Christopher H | last post by:
I've been reading about how C# passes ArrayLists as reference and Structs as value, but I still can't get my program to work like I want it to. Simple example: ...
8
by: Guy | last post by:
Is there a better way to search identical elements in a sorted array list than the following: iIndex = Array.BinarySearch( m_Array, 0, m_Array.Count, aSearchedObject ); aFoundObject= m_Array;...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.