Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Is there a way to create an array of strings index ??

please help me what is the name of array in c# that has string index rather than numeric index????????



thanks

Comments

  • ImDaFrEaKImDaFrEaK Member Posts: 29
    [b][red]This message was edited by ImDaFrEaK at 2006-3-27 13:6:50[/red][/b][hr]
    Most definataly. You need to research a HashTable. It is my favorite varibale ever. It will hold any object, String, Number, Array, Class, and another Hashtable, in the array and the array index can be found via Key or String. Here's a small example to look at.

    Dim MyHash as new HashTable
    MyHash.add("My House", "213 Wyoming St.")

    'MyHash.add('this is the key in which you find the index, 'this is the value that is stored)
    'MyHash.add(key, value)

    MyHash.add("Her House", "820 Elk Grove")

    label1.text = MyHash.item("My House")

    label1 displays "213 Wyoming St."

    Or use a do while loop to display all the keys in the Hash :) If you need more help with HashTables just ask but there fairly simply to learn and here are some other great traits I love about them.

    They automatically SyncLock so to speak, or I should say they are thread safe. The Look up method used within the Hash for finding objects values is remarkably fast. O, I already told you, you can store practically anything into the Hashtable. This is awesome b/c I use one hashtable to store everything about my application to file and restore the application on load with the Hashtable. It's completely serializable and this works like a charm. I think you will be most pleased with using this. However; it will require you to re-think and re-program some methods to utilize its features as opposed to simple bubble sorting and ect. The features it supplies are equally as fast and reliable just used slightly differently.




Sign In or Register to comment.