I have a VBScript ASP, and I really want to use hash tables. I can use the VB Collection data structure as a hash table, but I can't get it to work in VBScript.
Am I correct in guessing that one can't use the Collection structure in VBScript?
Printable View
I have a VBScript ASP, and I really want to use hash tables. I can use the VB Collection data structure as a hash table, but I can't get it to work in VBScript.
Am I correct in guessing that one can't use the Collection structure in VBScript?
How about using the Dictionary Object in asp/vbscript, its amost the same as the Collection object in VB.
Hope this helps.
Danial
http://msdn.microsoft.com/library/de...bscripttoc.asp
MSDN is terribly not helpful. Is there any documentation on this dictionary data type?
Here is one, do search on google for "Dictionary Object" and you will find loads of links.
http://www.w3schools.com/asp/asp_ref_dictionary.asp
So, what is the difference between a dictionary structure and a collection structure?
Hi Travis,
Personally i havent used the Dictionary object, but have seen other people using it. Here is a link From MSDN which should answer your question.
I think asp.net supports collection object and something similar to hash table. Do check the specification of asp.net if you are interested.
http://support.microsoft.com/default...;EN-US;q187234
Quote:
The Dictionary is quite similar to the Collection object in both functionality and purpose. The Dictionary, however, offers some functionality that is not available with a Collection. Some of these features include:
The option to specify a comparison method for Keys. This allows for a case-sensitive Key, for example.
A method for determining if an object exists in a Dictionary.
A method for extracting all of the Keys into an Array.
A method for extracting all of the Items into an Array.
A method for changing a Key value.
A method for removing all items from the Dictionary.
Dictionary Keys are not limited to String datatype.
NOTE: One important difference between the Collection object and the Dictionary object is the behavior of the Item property. If you use the Item property to reference a nonexistent Key in a Collection, you will receive an error. If you use the Item property to reference a nonexistent Key in a Dictionary, that Key will be added to the Dictionary. Use the Exists method to determine whether or not a Key is present in a Dictionary.
The Dictionary object is a component of the Microsoft Scripting library, which does not ship with Visual Basic version 5.0 or later.
Thanks for you help.
My client sees no immediate need to change to ASP.NET. And if I had any influence I would push them toward a more portable standard than .NET.