tags:

views:

164

answers:

1

I have to write something in vbscript that need to use a unique set. I am looking for something akin to Java's HashSet, is this already in vbscript or do I have to write my own?

+5  A: 

It's not identical, but VBScript has a Dictionary object which behaves like Java's Map or Hashtable.

You can use this almost like a HashSet, by just looking up the item as a key in the dictionary and finding if there is any value there. When you want to put something into the set, simply set its value to 1 or anything else.

Leigh Caldwell
I google vbs HashSet and found only reference to Dictionary. I was hoping for something more straightforward, but this will do the trick.
greencrab
Greencrab, don't forget then to mark this answer as accepted
AnthonyWJones