Hashtables

J

Jon Skeet [C# MVP]

Brandon Owensby said:
I'm not planning on storing it anywhere. I just wanna be able to take a
class....that is base on instance....not value and use is as a key to a
hashtable. In otherwords...as an example:


Form form = ???;

Hashtable hashtable = new Hashtable();

hashtable.Add(form, somevalue);

somevalueholder = hashtable[form];

I have done this without problem....but my supervisor was concerned it
wouldn't always work. I am seeming to understand that that is fine. The
key doesn't have to be instance based.

Well, I don't know what you mean by "that is base on instance" but the
above will be fine.
 
B

Brandon Owensby

Thanks alot....and to clarify...what I meant by "base on instance" which
should of read "based on instance" is that something that isnt' based on the
value of the object such as int or decimal but by the instance of the
object. for a form is never equal to a form based on values...only on
instance.

Thanks again for all your help.

Brandon Owensby


PS - Is this information based only on Everret or does it apply to VS 2003
C# .Net 1.1 as well?
 
J

Jon Skeet [C# MVP]

Brandon Owensby said:
Thanks alot....and to clarify...what I meant by "base on instance" which
should of read "based on instance" is that something that isnt' based on the
value of the object such as int or decimal but by the instance of the
object. for a form is never equal to a form based on values...only on
instance.

Thanks again for all your help.

Brandon Owensby


PS - Is this information based only on Everret or does it apply to VS 2003
C# .Net 1.1 as well?

Everett *is* VS.NET 2003/.NET 1.1. However, I think it'll be safe to
rely on this behaviour forever.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top