This message was edited by aarunlal at 2005-9-7 22:44:15
Thnak u very much Mr.iwilld0it ..
Can you send some good urls regarding this ..
regards
Arunlal
: : WHat is the difference between a Hash Table and array ??
: :
: : regards
: : arunlal
: :
:
: An array is a collection of data, where each data item (element) has to be the the same data type. Array elements are allocated consecutively in the same memory space and are indexed via an integer index.
:
: Creating a VB Array:
:
:
: Dim names(1) As String
:
: names(0) = "John Doe"
: names(1) = "Jane Doe"
:
:
: This is an array of strings. You can create an array of any object ...
:
:
: Dim arr(20) As CustomObject
:
:
: Indexing an array ...
:
:
: ' Writes: Hello Jane Doe
: Response.Write("Hello " & names(1))
:
:
: Hash table is a data structure that provides lookup semantics via an object key. Typically the key is a string, however under .NET, it can be any Object and particualy objects that provide a decent override of the Base Objects GetHashCode() function. A hash code is an algorithically generated id that should make an object key distinct.
:
: Creating a hashtable:
:
:
: Dim lookup As New HashTable()
:
: lookup("NY") = "New York"
: lookup("PA") = "Pennsylvania"
: ' ...
:
:
: In this example, "NY" and "PA" are the lookup keys, while the items after the equal sign are the values to store.
:
: Using the hashtable ...
:
:
: ' Writes: I am from New York
: Response.Write("I am from " & lookup("NY").ToString())
:
:
: There is really more to these data structures than the basic descriptions I am giving you.
:
: For instance under .NET, arrays are objects that derive from the base Array class and implement IEnumerable so that array elements can be enumerated with a For-Each loop.
:
: Hash tables hold a collection of DictionaryEntry objects, where a DictionaryEntry holds the Key along with its value.
:
: You really have to read more into this online.
:
:
:
:
:
: