473,407 Members | 2,546 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,407 software developers and data experts.

Change A Value In a HashTable?

I have a collection of objects in a hashtable.

The objects have a datamember that is empty.

I need to loop through the items in the hashtable and add data to the
datamember that is empty.

htShippingItems is the hashtable which contains a collection of
ShippingItems. Each shipping item has a datamember called Itemized that I
need to populate with a string.
-----------------------------------------------------------------
Sub MergeMultiples

Dim m As clsMultiple
Dim s As clsShippingItem
Dim str As String
For Each s In htShippingItems.Values
If s.Multi = "-1" Then
For Each m In htMultiples.Values
If m.Multi = s.ItemID Then
str &= m.ItemID & "," & m.Description & ","
End If
Next
str = str.TrimEnd(",")
s.Itemized = str

End If
str = ""
Next

End Sub
--------------------------------------------------------------------

Im obtaining the data I need from another hashtable which contains a
collection of Multiple Objects.

At the point of str = str.TrimEnd(",") the str variable contains the desired
data and it gets assigned to s.Itemized.

But Afterwards if I try to access the Itemized member from the hashtable it
is null.
Thanks for any help
Slonocode

Nov 20 '05 #1
1 3008
Oops nevermind the code I posted actually works I had a logic error
elsewhere that was preventing me from seeing the data I wanted.


Nov 20 '05 #2

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

Similar topics

3
by: oliver.wulff | last post by:
Does there exist a class similar to a hashtable which provides a key-value pair collection. The key and the value has to be a string?
2
by: PABLO | last post by:
Hello I have a Hastable, which I need to order it by value and not by key. Regards
1
by: Pavils Jurjans | last post by:
Hello, I am building custom hashtable class, and thinking about value retrieval issues. The thing is, that sometimes the hashtable value may contain value null. If someone is reading this value...
2
by: BCM | last post by:
How do you reset a value for an existing key in a hashtable? I need to create a collection and compare the values with another collection: when certain parameters are met then I need to reset the...
7
by: Dan | last post by:
I have the need to translate values back and forth. I have created a Hashtable to do this because I don't care about intrinsic order and I want it to be a fast as possible. My only concern is...
3
by: Oberon | last post by:
How do I deal with this? I am getting an error for each get in the Game class (see code below). In the simplified example below I have reduced this to just 3 fields, one which can be NULL. I...
7
by: ad | last post by:
I have a hash table like: Hashtable myHT = new Hashtable(); myHT.Add("First", "Hello"); myHT.Add("Second", "World"); myHT.Add("Third", "!"); We can use key to find value like: myHT -> "Hello"...
23
by: illegal.prime | last post by:
Hi all, is there a key value collection in .Net that maintains the ordering in which I add items. I'm finding that I'm creating a number of classes that contain a name and then some object. I...
3
by: Rich | last post by:
Hello, I populate a hashtable with recordID's in a "For i=0 to n" loop. Some recordID's are duplicate but for different rows (recordID is not a key field in this scenario). I use the value of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.