unique arrays

  • Thread starter Thread starter Paulers
  • Start date Start date
P

Paulers

Hello all, I just picked up my virst vb.net book last weekend and Im
hooked. Can anyone tell my if there is a way to keep array elements
unique? Or possibly in another data collection that might have that
characteristic, Im not bound to arrays. I have been searching all over
the net including groups.google.com and I can't find any information.
 
Hi,

To expand on what Anand says. I would use an HashTable. Here
is a link to some info on it.

http://msdn.microsoft.com/library/d...frlrfsystemcollectionshashtableclasstopic.asp

Ken
----------------
Hello all, I just picked up my virst vb.net book last weekend and Im
hooked. Can anyone tell my if there is a way to keep array elements
unique? Or possibly in another data collection that might have that
characteristic, Im not bound to arrays. I have been searching all over
the net including groups.google.com and I can't find any information.
 
Paulers said:
Can anyone tell my if there is a way to keep array elements
unique? Or possibly in another data collection that might have that
characteristic, Im not bound to arrays.

\\\
Dim ht As New Hashtable()
Dim o1 As New Object()
Dim o2 As New Object()
ht.Add(o1, o1)
MsgBox(ht.Contains(o1))
MsgBox(ht.Contains(o2))
///
 
Thanks you very much for all your help. I really appreciate it. I will
take a look at HashTables.
 

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

Back
Top