Reading from HashTable

  • Thread starter Thread starter Kavvy
  • Start date Start date
K

Kavvy

What is the member function to return values from a HashTable? I've been up
and down the list in VS and I cannot find anything of relevance.

All the examples speak of a member function named "item", well it just
isn't there!

Cheers
Rich.
 
The member function is there; it just looks different in C#. In the
documentation if you click through on the member variable, it will give you
the definition of the function in VB, C#, C++, and JScript. The C#
definition looks like this:

[Serializable]
public virtual object this[
object key
] { get; set;}

In a practical example, the way that the item is retrieved would look like
this;

object item = ht[key]; //where ht is a hashtable and key is the object key.

Hope this helps.
 
The member function is there; it just looks different in C#. In the
documentation if you click through on the member variable, it will give you
the definition of the function in VB, C#, C++, and JScript. The C#
definition looks like this:

[Serializable]
public virtual object this[
object key
] { get; set;}

In a practical example, the way that the item is retrieved would look like
this;

object item = ht[key]; //where ht is a hashtable and key is the object key.

Hope this helps.

Thank you, time for a good book I think!
 
Back
Top