Results 1 to 3 of 3

Thread: Collections?!

  1. #1

    Thread Starter
    Registered User
    Join Date
    Apr 2003
    Posts
    61

    Question Collections?!

    Is there a collection object to store 4 values, for exam the hashtable only stores 2, i want something that looks like this
    KEY_VALUE_VALUE_VALUE

    of corse we can use databases, what i want is something like the hashtable, is there any object? or can we expand other options to get something like this?!

  2. #2
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681
    You could have an array with 4 dimensions. Or you could just define your own class that would have 4 properties, then have an array or arraylist of these. You could also extend and create your own collection that would have Key / Value / Value / Value.

  3. #3
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    going more indepth

    create a class
    Code:
    Class blah
       Public Name As String
       Public SomeData As Integer
    End Class
    then create an instance and populate the data

    Code:
    Dim b as New blah()
    b.Name = "Cander"
    b.SomeData = 23
    then add it to the hashtable

    Code:
    myhash.Add(b,"some uniqure key")
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width