Professional Web Applications Themes

Manipulating HashTables - ASP.NET General

Hi everybody, Does anyone know how to get the key of the last item added to a hashtable? Many thanks, Andy. (ASP.NET virgin, ready for sacrifice)...

  1. #1

    Default Manipulating HashTables

    Hi everybody,

    Does anyone know how to get the key of the last item added to a hashtable?

    Many thanks,

    Andy. (ASP.NET virgin, ready for sacrifice)


    Andrew Guest

  2. #2

    Default Re: Manipulating HashTables

    I don't believe the hashtable stores that information (the order in which
    items were inserted.)
    If you're using VB.NET the built in collection class should give you the
    functionality you desire:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcn7/html/vbconthevisualbasiccollectionobject.asp

    If you're using C# you'll probably have to do things the hard way (as
    usual.) You might consider inheriting from the hashtable to add this
    functionality.
    Here's more info:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemcollectionshashtableclasstopic.asp

    Or maybe another kind of collection class might work out better for you.
    Perhaps a Queue?
    Here's more info:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemcollections.asp

    --
    I hope this helps,
    Steve C. Orr, MCSD
    http://Steve.Orr.net
    Hire top-notch developers at http://www.able-consulting.com



    "Andrew Sweetman" <com> wrote in message
    news:7kv1b.1142$server.ntli.net... 


    Steve Guest

  3. #3

    Default Re: Manipulating HashTables

    I meant a Stack, not a Queue.

    Also, even if you're using C# you could "cheat" and import the VB.NET
    namespace and use the collection object anyway.
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcn7/html/vbconthevisualbasiccollectionobject.asp

    --
    I hope this helps,
    Steve C. Orr, MCSD
    http://Steve.Orr.net
    Hire top-notch developers at http://www.able-consulting.com



    "Steve C. Orr, MCSD" <net> wrote in message
    news:ue$phx.gbl... 
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcn7/html/vbconthevisualbasiccollectionobject.asp 
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemcollectionshashtableclasstopic.asp 
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemcollections.asp [/ref]
    hashtable? 
    >
    >[/ref]


    Steve Guest

Similar Threads

  1. Hashtables And Webservices
    By Niklas Magnusson in forum ASP.NET Web Services
    Replies: 6
    Last Post: April 25th, 05:15 PM
  2. [PHP-DEV] [PATCH] Internal Hashtables bug
    By Cristiano Duarte in forum PHP Development
    Replies: 0
    Last Post: November 11th, 09:39 PM
  3. [PHP-DEV] internal hashtables [patch included]
    By Cristiano Duarte in forum PHP Development
    Replies: 0
    Last Post: November 10th, 03:02 AM
  4. [PHP-DEV] internal hashtables [patch included]
    By Cristiano Duarte in forum PHP Development
    Replies: 0
    Last Post: November 10th, 03:00 AM
  5. [PHP-DEV] internal hashtables [patch included]
    By Andi Gutmans in forum PHP Development
    Replies: 6
    Last Post: November 10th, 02:52 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139